diff --git a/BUILD.gn b/BUILD.gn index 9e997b05eb689ab37d95d131146862512c23e00a..936c8cb4079cbe7ed1213ed92153bddbc2c7941b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -8,7 +8,6 @@ group("flutter") { deps = [ "//flutter/lib/snapshot:generate_snapshot_bin", "//flutter/sky", - "//lib/txt", ] if (is_fuchsia) { @@ -31,8 +30,6 @@ group("flutter") { "//flutter/sky/engine/wtf:wtf_unittests", "//flutter/synchronization:synchronization_unittests", "//lib/ftl:ftl_unittests", - "//lib/txt/examples:txt_example($host_toolchain)", - "//lib/txt/tests($host_toolchain)", # txt_unittests ] } } diff --git a/DEPS b/DEPS index e76c0f0459c2e11363c64163b2ca4cefb0286bfd..2e0a1ae93c8c27d77f3da96ddcf870c9abbf230b 100644 --- a/DEPS +++ b/DEPS @@ -71,9 +71,6 @@ deps = { 'src/lib/zip': Var('fuchsia_git') + '/zip' + '@' + '92dc87ca645fe8e9f5151ef6dac86d8311a7222f', - 'src/lib/txt': - Var('fuchsia_git') + '/txt' + '@' + 'b44e28c2fd75d7d4b9dcc862bb2c01a090bb53e1', - 'src/third_party/gtest': Var('fuchsia_git') + '/third_party/gtest' + '@' + 'c00f82917331efbbd27124b537e4ccc915a02b72', diff --git a/common/settings.h b/common/settings.h index 0846264f7260c2c8ad954af0f07707692b5a04cc..8fd9de59d9357145c366b05d8015a6ae413f9859 100644 --- a/common/settings.h +++ b/common/settings.h @@ -27,7 +27,6 @@ struct Settings { bool use_test_fonts = false; bool dart_non_checked_mode = false; bool enable_software_rendering = false; - bool using_blink = true; std::string aot_snapshot_path; std::string aot_vm_snapshot_data_filename; std::string aot_vm_snapshot_instr_filename; diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 517dd70cfd0f6c61e6137c3ac33fc0c67a2538fe..fd02dab359265e777b0bbadba7460934b079cf8c 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -3,7 +3,6 @@ # found in the LICENSE file. source_set("ui") { - sources = [ "compositing/scene.cc", "compositing/scene.h", @@ -56,12 +55,6 @@ source_set("ui") { "text/paragraph.h", "text/paragraph_builder.cc", "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", "text/text_box.h", "ui_dart_state.cc", @@ -90,6 +83,5 @@ source_set("ui") { "//lib/tonic", "//third_party/skia", "//third_party/skia:gpu", - "//lib/txt", ] } diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index c7fd4e42225f27a0a4e242f3a8eeac163a14b405..9f29d3d089e02deb7cc707c0af954f87b994dca7 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -4,16 +4,14 @@ #include "flutter/lib/ui/text/paragraph.h" -#include "flutter/common/settings.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" +#include "flutter/sky/engine/core/rendering/RenderParagraph.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/ftl/tasks/task_runner.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" @@ -33,7 +31,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Paragraph); V(Paragraph, maxIntrinsicWidth) \ V(Paragraph, alphabeticBaseline) \ V(Paragraph, ideographicBaseline) \ - V(Paragraph, didExceedMaxLines) \ + V(Paragraph, didExceedMaxLines) \ V(Paragraph, layout) \ V(Paragraph, paint) \ V(Paragraph, getWordBoundary) \ @@ -43,65 +41,155 @@ 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))) {} + : m_renderView(renderView) {} Paragraph::~Paragraph() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + Threads::UI()->PostTask( + [renderView]() { renderView->destroy(); }); } } double Paragraph::width() { - return m_paragraphImpl->width(); + return firstChildBox()->width(); } double Paragraph::height() { - return m_paragraphImpl->height(); + return firstChildBox()->height(); } double Paragraph::minIntrinsicWidth() { - return m_paragraphImpl->minIntrinsicWidth(); + return firstChildBox()->minPreferredLogicalWidth(); } double Paragraph::maxIntrinsicWidth() { - return m_paragraphImpl->maxIntrinsicWidth(); + return firstChildBox()->maxPreferredLogicalWidth(); } double Paragraph::alphabeticBaseline() { - return m_paragraphImpl->alphabeticBaseline(); + return firstChildBox()->firstLineBoxBaseline( + FontBaselineOrAuto(AlphabeticBaseline)); } double Paragraph::ideographicBaseline() { - return m_paragraphImpl->ideographicBaseline(); + return firstChildBox()->firstLineBoxBaseline( + FontBaselineOrAuto(IdeographicBaseline)); } bool Paragraph::didExceedMaxLines() { - return m_paragraphImpl->didExceedMaxLines(); + RenderBox* box = firstChildBox(); + ASSERT(box->isRenderParagraph()); + RenderParagraph* paragraph = static_cast(box); + return paragraph->didExceedMaxLines(); } void Paragraph::layout(double width) { - m_paragraphImpl->layout(width); + FontCachePurgePreventer fontCachePurgePreventer; + + int maxWidth = LayoutUnit(width); // Handles infinity properly. + m_renderView->setFrameViewSize(IntSize(maxWidth, intMaxForLayoutUnit)); + m_renderView->layout(); } void Paragraph::paint(Canvas* canvas, double x, double y) { - m_paragraphImpl->paint(canvas, x, 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(); + FTL_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 Paragraph::getRectsForRange(unsigned start, unsigned end) { - return m_paragraphImpl->getRectsForRange(start, 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 Paragraph::absoluteOffsetForPosition(const PositionWithAffinity& position) { + FTL_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(); + } + } + FTL_DCHECK(false); + return 0; } Dart_Handle Paragraph::getPositionForOffset(double dx, double dy) { - return m_paragraphImpl->getPositionForOffset(dx, dy); + LayoutPoint point(dx, dy); + PositionWithAffinity position = m_renderView->positionForPoint(point); + Dart_Handle result = Dart_NewList(2); + Dart_ListSetAt(result, 0, ToDart(absoluteOffsetForPosition(position))); + Dart_ListSetAt(result, 1, ToDart(static_cast(position.affinity()))); + return result; } Dart_Handle Paragraph::getWordBoundary(unsigned offset) { - return m_paragraphImpl->getWordBoundary(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_NewList(2); + Dart_ListSetAt(result, 0, ToDart(start)); + Dart_ListSetAt(result, 1, ToDart(end)); + return result; } } // namespace blink diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index 0e8525b0ab3507ad30f942c2a5a2b5ca5e06d56e..e75025b07a01e1b08aed4276c5e33046f3a265ea 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -6,14 +6,9 @@ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_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 "lib/tonic/dart_wrappable.h" -#include "lib/txt/src/paragraph.h" namespace tonic { class DartLibraryNatives; @@ -27,15 +22,10 @@ class Paragraph : public ftl::RefCountedThreadSafe, FRIEND_MAKE_REF_COUNTED(Paragraph); public: - static ftl::RefPtr Create(PassOwnPtr renderView) { + static ftl::RefPtr create(PassOwnPtr renderView) { return ftl::MakeRefCounted(renderView); } - static ftl::RefPtr Create( - std::unique_ptr paragraph) { - return ftl::MakeRefCounted(std::move(paragraph)); - } - ~Paragraph() override; double width(); @@ -58,13 +48,11 @@ class Paragraph : public ftl::RefCountedThreadSafe, static void RegisterNatives(tonic::DartLibraryNatives* natives); private: - std::unique_ptr m_paragraphImpl; - RenderBox* firstChildBox() const { return m_renderView->firstChildBox(); } - explicit Paragraph(PassOwnPtr renderView); + int absoluteOffsetForPosition(const PositionWithAffinity& position); - explicit Paragraph(std::unique_ptr paragraph); + explicit Paragraph(PassOwnPtr renderView); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index a65762e1805c416d3d14da8f966da911b51792a6..f25331869ba96ba69b4013435d8afca33c352f51 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/text/paragraph_builder.h" -#include "flutter/common/settings.h" #include "flutter/common/threads.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/sky/engine/core/rendering/RenderInline.h" @@ -17,12 +16,6 @@ #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" -#include "lib/txt/src/font_style.h" -#include "lib/txt/src/font_weight.h" -#include "lib/txt/src/paragraph_style.h" -#include "lib/txt/src/text_align.h" -#include "lib/txt/src/text_decoration.h" -#include "lib/txt/src/text_style.h" namespace blink { namespace { @@ -102,12 +95,13 @@ void createFontForDocument(RenderStyle* style) { style->font().update(UIDartState::Current()->font_selector()); } -PassRefPtr decodeParagraphStyle(RenderStyle* parentStyle, - tonic::Int32List& encoded, - const std::string& fontFamily, - double fontSize, - double lineHeight, - const std::string& ellipsis) { +PassRefPtr decodeParagraphStyle( + RenderStyle* parentStyle, + tonic::Int32List& encoded, + const std::string& fontFamily, + double fontSize, + double lineHeight, + const std::string& ellipsis) { FTL_DCHECK(encoded.num_elements() == 5); RefPtr style = RenderStyle::create(); @@ -193,8 +187,8 @@ ftl::RefPtr ParagraphBuilder::create( double fontSize, double lineHeight, const std::string& ellipsis) { - return ftl::MakeRefCounted(encoded, fontFamily, fontSize, - lineHeight, ellipsis); + return ftl::MakeRefCounted( + encoded, fontFamily, fontSize, lineHeight, ellipsis); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, @@ -202,61 +196,24 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, double fontSize, double lineHeight, const std::string& ellipsis) { - if (!Settings::Get().using_blink) { - int32_t mask = encoded[0]; - txt::ParagraphStyle style; - if (mask & psTextAlignMask) - style.text_align = txt::TextAlign(encoded[psTextAlignIndex]); - - if (mask & (psFontWeightMask | psFontStyleMask | psFontFamilyMask | - psFontSizeMask)) { - 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; - - if (mask & psFontSizeMask) - style.font_size = fontSize; - } - - if (mask & psLineHeightMask) - style.line_height = lineHeight; + createRenderView(); - if (mask & psMaxLinesMask) - style.max_lines = encoded[psMaxLinesIndex]; + RefPtr paragraphStyle = decodeParagraphStyle( + m_renderView->style(), encoded, fontFamily, fontSize, lineHeight, ellipsis); + encoded.Release(); - if (mask & psEllipsisMask) - style.ellipsis = ellipsis; + m_renderParagraph = new RenderParagraph(); + m_renderParagraph->setStyle(paragraphStyle.release()); - m_paragraphBuilder.SetParagraphStyle(style); - } else { - // Blink version. - createRenderView(); - - RefPtr paragraphStyle = - decodeParagraphStyle(m_renderView->style(), encoded, fontFamily, - fontSize, lineHeight, ellipsis); - encoded.Release(); - - m_renderParagraph = new RenderParagraph(); - m_renderParagraph->setStyle(paragraphStyle.release()); - - m_currentRenderObject = m_renderParagraph; - m_renderView->addChild(m_currentRenderObject); - } - -} // namespace blink + m_currentRenderObject = m_renderParagraph; + m_renderView->addChild(m_currentRenderObject); +} ParagraphBuilder::~ParagraphBuilder() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + Threads::UI()->PostTask( + [renderView]() { renderView->destroy(); }); } } @@ -267,167 +224,98 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, double wordSpacing, double height) { FTL_DCHECK(encoded.num_elements() == 8); + RefPtr style = RenderStyle::create(); + style->inheritFrom(m_currentRenderObject->style()); int32_t mask = encoded[0]; - if (!Settings::Get().using_blink) { - txt::TextStyle tstyle; - - if (mask & tsColorMask) - tstyle.color = encoded[tsColorIndex]; - - if (mask & tsTextDecorationMask) { - tstyle.decoration = - static_cast(encoded[tsTextDecorationIndex]); - } - - if (mask & tsTextDecorationColorMask) - tstyle.decoration_color = encoded[tsTextDecorationColorIndex]; - - if (mask & tsTextDecorationStyleMask) - tstyle.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) - tstyle.font_weight = - static_cast(encoded[tsFontWeightIndex]); + if (mask & tsColorMask) + style->setColor(getColorFromARGB(encoded[tsColorIndex])); - if (mask & tsFontStyleMask) - tstyle.font_style = - static_cast(encoded[tsFontStyleIndex]); - - if (mask & tsFontFamilyMask) - tstyle.font_family = fontFamily; + if (mask & tsTextDecorationMask) { + style->setTextDecoration( + static_cast(encoded[tsTextDecorationIndex])); + style->applyTextDecorations(); + } - if (mask & tsFontSizeMask) - tstyle.font_size = fontSize; + if (mask & tsTextDecorationColorMask) + style->setTextDecorationColor( + StyleColor(getColorFromARGB(encoded[tsTextDecorationColorIndex]))); - if (mask & tsLetterSpacingMask) - tstyle.letter_spacing = letterSpacing; + if (mask & tsTextDecorationStyleMask) + style->setTextDecorationStyle( + static_cast(encoded[tsTextDecorationStyleIndex])); - if (mask & tsWordSpacingMask) - tstyle.word_spacing = wordSpacing; - } + if (mask & tsTextBaselineMask) { + // TODO(abarth): Implement TextBaseline. The CSS version of this + // property wasn't wired up either. + } - if (mask & tsHeightMask) { - tstyle.height = height; - } + if (mask & (tsFontWeightMask | tsFontStyleMask | tsFontFamilyMask | + tsFontSizeMask | tsLetterSpacingMask | tsWordSpacingMask)) { + FontDescription fontDescription = style->fontDescription(); - m_paragraphBuilder.PushStyle(tstyle); - } else { - // Blink Version. - RefPtr style = RenderStyle::create(); - style->inheritFrom(m_currentRenderObject->style()); + if (mask & tsFontWeightMask) + fontDescription.setWeight( + static_cast(encoded[tsFontWeightIndex])); - if (mask & tsColorMask) - style->setColor(getColorFromARGB(encoded[tsColorIndex])); + if (mask & tsFontStyleMask) + fontDescription.setStyle( + static_cast(encoded[tsFontStyleIndex])); - if (mask & tsTextDecorationMask) { - style->setTextDecoration( - static_cast(encoded[tsTextDecorationIndex])); - style->applyTextDecorations(); + if (mask & tsFontFamilyMask) { + FontFamily family; + family.setFamily(String::fromUTF8(fontFamily)); + fontDescription.setFamily(family); } - if (mask & tsTextDecorationColorMask) - style->setTextDecorationColor( - StyleColor(getColorFromARGB(encoded[tsTextDecorationColorIndex]))); - - if (mask & tsTextDecorationStyleMask) - style->setTextDecorationStyle(static_cast( - encoded[tsTextDecorationStyleIndex])); - - if (mask & tsTextBaselineMask) { - // TODO(abarth): Implement TextBaseline. The CSS version of this - // property wasn't wired up either. + if (mask & tsFontSizeMask) { + fontDescription.setSpecifiedSize(fontSize); + fontDescription.setIsAbsoluteSize(true); + fontDescription.setComputedSize( + getComputedSizeFromSpecifiedSize(fontSize)); } - if (mask & (tsFontWeightMask | tsFontStyleMask | tsFontFamilyMask | - tsFontSizeMask | tsLetterSpacingMask | tsWordSpacingMask)) { - FontDescription fontDescription = style->fontDescription(); - - if (mask & tsFontWeightMask) - fontDescription.setWeight( - static_cast(encoded[tsFontWeightIndex])); - - if (mask & tsFontStyleMask) - fontDescription.setStyle( - static_cast(encoded[tsFontStyleIndex])); + if (mask & tsLetterSpacingMask) + fontDescription.setLetterSpacing(letterSpacing); - if (mask & tsFontFamilyMask) { - FontFamily family; - family.setFamily(String::fromUTF8(fontFamily)); - fontDescription.setFamily(family); - } + if (mask & tsWordSpacingMask) + fontDescription.setWordSpacing(wordSpacing); - if (mask & tsFontSizeMask) { - fontDescription.setSpecifiedSize(fontSize); - fontDescription.setIsAbsoluteSize(true); - fontDescription.setComputedSize( - getComputedSizeFromSpecifiedSize(fontSize)); - } - - if (mask & tsLetterSpacingMask) - fontDescription.setLetterSpacing(letterSpacing); - - if (mask & tsWordSpacingMask) - fontDescription.setWordSpacing(wordSpacing); - - style->setFontDescription(fontDescription); - style->font().update(UIDartState::Current()->font_selector()); - } + style->setFontDescription(fontDescription); + style->font().update(UIDartState::Current()->font_selector()); + } - if (mask & tsHeightMask) { - style->setLineHeight(Length(height * 100.0, Percent)); - } + if (mask & tsHeightMask) { + style->setLineHeight(Length(height * 100.0, Percent)); + } - encoded.Release(); + encoded.Release(); - RenderObject* span = new RenderInline(); - span->setStyle(style.release()); - m_currentRenderObject->addChild(span); - m_currentRenderObject = span; - } + RenderObject* span = new RenderInline(); + span->setStyle(style.release()); + m_currentRenderObject->addChild(span); + m_currentRenderObject = span; } void ParagraphBuilder::pop() { - if (!Settings::Get().using_blink) { - m_paragraphBuilder.Pop(); - } else { - // Blink Version. - if (m_currentRenderObject) - m_currentRenderObject = m_currentRenderObject->parent(); - } + if (m_currentRenderObject) + m_currentRenderObject = m_currentRenderObject->parent(); } void ParagraphBuilder::addText(const std::string& text) { - if (!Settings::Get().using_blink) { - m_paragraphBuilder.AddText(text); - } else { - // Blink Version. - if (!m_currentRenderObject) - return; - RenderText* renderText = new RenderText(String::fromUTF8(text).impl()); - RefPtr style = RenderStyle::create(); - style->inheritFrom(m_currentRenderObject->style()); - renderText->setStyle(style.release()); - m_currentRenderObject->addChild(renderText); - } + if (!m_currentRenderObject) + return; + RenderText* renderText = new RenderText(String::fromUTF8(text).impl()); + RefPtr style = RenderStyle::create(); + style->inheritFrom(m_currentRenderObject->style()); + renderText->setStyle(style.release()); + m_currentRenderObject->addChild(renderText); } ftl::RefPtr ParagraphBuilder::build() { m_currentRenderObject = nullptr; - if (!Settings::Get().using_blink) { - return Paragraph::Create(m_paragraphBuilder.Build()); - } else { - return Paragraph::Create(m_renderView.release()); - } + return Paragraph::create(m_renderView.release()); } void ParagraphBuilder::createRenderView() { diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 6d6cba033452342ef9567ac5c16dec35c5a6b359..7a156f23c2d6d82161742ff790a0d9aed2aa42e2 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -6,11 +6,8 @@ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_BUILDER_H_ #include "flutter/lib/ui/text/paragraph.h" -#include "flutter/sky/engine/core/rendering/RenderObject.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" #include "lib/tonic/dart_wrappable.h" #include "lib/tonic/typed_data/int32_list.h" -#include "lib/txt/src/paragraph_builder.h" namespace tonic { class DartLibraryNatives; @@ -18,8 +15,6 @@ class DartLibraryNatives; namespace blink { -class Paragraph; - class ParagraphBuilder : public ftl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); @@ -40,7 +35,6 @@ class ParagraphBuilder : public ftl::RefCountedThreadSafe, double letterSpacing, double wordSpacing, double height); - void pop(); void addText(const std::string& text); @@ -61,7 +55,6 @@ class ParagraphBuilder : public ftl::RefCountedThreadSafe, OwnPtr m_renderView; RenderObject* m_renderParagraph; RenderObject* m_currentRenderObject; - txt::ParagraphBuilder m_paragraphBuilder; }; } // namespace blink diff --git a/lib/ui/text/paragraph_impl.cc b/lib/ui/text/paragraph_impl.cc deleted file mode 100644 index 65483a8b68142f5095a8b598e7b454e6a547300f..0000000000000000000000000000000000000000 --- a/lib/ui/text/paragraph_impl.cc +++ /dev/null @@ -1,7 +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.h" - -namespace blink {} // namespace blink diff --git a/lib/ui/text/paragraph_impl.h b/lib/ui/text/paragraph_impl.h deleted file mode 100644 index f8e1ef09d4be2273e827fe29be02a970f99b044a..0000000000000000000000000000000000000000 --- a/lib/ui/text/paragraph_impl.h +++ /dev/null @@ -1,45 +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_H_ -#define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_H_ - -#include "flutter/lib/ui/painting/canvas.h" -#include "flutter/lib/ui/text/text_box.h" - -namespace blink { - -class ParagraphImpl { - public: - virtual ~ParagraphImpl(){}; - - virtual double width() = 0; - - virtual double height() = 0; - - virtual double minIntrinsicWidth() = 0; - - virtual double maxIntrinsicWidth() = 0; - - virtual double alphabeticBaseline() = 0; - - virtual double ideographicBaseline() = 0; - - virtual bool didExceedMaxLines() = 0; - - virtual void layout(double width) = 0; - - virtual void paint(Canvas* canvas, double x, double y) = 0; - - virtual std::vector getRectsForRange(unsigned start, - unsigned end) = 0; - - virtual Dart_Handle getPositionForOffset(double dx, double dy) = 0; - - virtual Dart_Handle getWordBoundary(unsigned offset) = 0; -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_H_ diff --git a/lib/ui/text/paragraph_impl_blink.cc b/lib/ui/text/paragraph_impl_blink.cc deleted file mode 100644 index 55b5f05b7f5b833fe5cd6b5e319472d1d1455fe0..0000000000000000000000000000000000000000 --- 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/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" -#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/ftl/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(); - Threads::UI()->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(); - FTL_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) { - FTL_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(); - } - } - FTL_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_NewList(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_NewList(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 7557139d2de4e9002ab0af9a20fc06299f261e93..0000000000000000000000000000000000000000 --- a/lib/ui/text/paragraph_impl_blink.h +++ /dev/null @@ -1,49 +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/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 "lib/txt/src/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); - - OwnPtr m_renderView; -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ diff --git a/lib/ui/text/paragraph_impl_txt.cc b/lib/ui/text/paragraph_impl_txt.cc deleted file mode 100644 index 3ac12e6b3dfc13b01e486a8cbf0d939a4a1edc33..0000000000000000000000000000000000000000 --- a/lib/ui/text/paragraph_impl_txt.cc +++ /dev/null @@ -1,75 +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_txt.h" - -#include "flutter/common/threads.h" -#include "flutter/lib/ui/text/paragraph.h" -#include "flutter/lib/ui/text/paragraph_impl.h" -#include "lib/ftl/tasks/task_runner.h" -#include "lib/txt/src/paragraph_constraints.h" - -namespace blink { - -ParagraphImplTxt::ParagraphImplTxt(std::unique_ptr paragraph) - : m_paragraph(std::move(paragraph)) {} - -ParagraphImplTxt::~ParagraphImplTxt() {} - -double ParagraphImplTxt::width() { - return m_width; -} - -double ParagraphImplTxt::height() { - return m_paragraph->GetHeight(); -} - -double ParagraphImplTxt::minIntrinsicWidth() { - return m_paragraph->GetMinIntrinsicWidth(); -} - -double ParagraphImplTxt::maxIntrinsicWidth() { - return m_paragraph->GetMaxIntrinsicWidth(); -} - -double ParagraphImplTxt::alphabeticBaseline() { - return m_paragraph->GetAlphabeticBaseline(); -} - -double ParagraphImplTxt::ideographicBaseline() { - return m_paragraph->GetIdeographicBaseline(); -} - -bool ParagraphImplTxt::didExceedMaxLines() { - return m_paragraph->DidExceedMaxLines(); -} - -void ParagraphImplTxt::layout(double width) { - m_width = width; - m_paragraph->Layout(txt::ParagraphConstraints{width}); -} - -void ParagraphImplTxt::paint(Canvas* canvas, double x, double y) { - SkCanvas* sk_canvas = canvas->canvas(); - if (!sk_canvas) - return; - m_paragraph->Paint(sk_canvas, x, y); -} - -std::vector ParagraphImplTxt::getRectsForRange(unsigned start, - unsigned end) { - return std::vector{0ull}; -} - -Dart_Handle ParagraphImplTxt::getPositionForOffset(double dx, double dy) { - // TODO(garyq): Implement in the library. - return nullptr; -} - -Dart_Handle ParagraphImplTxt::getWordBoundary(unsigned offset) { - // TODO(garyq): Implement in the library. - return nullptr; -} - -} // namespace blink diff --git a/lib/ui/text/paragraph_impl_txt.h b/lib/ui/text/paragraph_impl_txt.h deleted file mode 100644 index 20f786a4326471dfe990e5120ec64769802be170..0000000000000000000000000000000000000000 --- a/lib/ui/text/paragraph_impl_txt.h +++ /dev/null @@ -1,44 +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_TXT_H_ -#define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_TXT_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/text_box.h" -#include "lib/txt/src/paragraph.h" - -namespace blink { - -class ParagraphImplTxt : public ParagraphImpl { - public: - ~ParagraphImplTxt() override; - - explicit ParagraphImplTxt(std::unique_ptr paragraph); - - 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; - - private: - std::unique_ptr m_paragraph; - double m_width = -1.0; -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_TXT_H_ diff --git a/shell/common/shell.cc b/shell/common/shell.cc index f2a679d700cf287ea0a03ea9907363e3bdb991a2..21eb3c916f031918953b94c9834eb98f0b386667 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -147,9 +147,6 @@ void Shell::InitStandalone(ftl::CommandLine command_line, settings.enable_software_rendering = command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); - settings.using_blink = - !command_line.HasOption(FlagForSwitch(Switch::EnableTxt)); - settings.endless_trace_buffer = command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); diff --git a/shell/common/switches.h b/shell/common/switches.h index ac43b92126f1c3a1fe101142731759c2a5b2b0d2..fe68fe13d6a5bc1a8448de111655c429db974747 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -63,9 +63,6 @@ DEF_SWITCH(EnableSoftwareRendering, "Enable rendering using the Skia software backend. This is useful" "when testing Flutter on emulators. By default, Flutter will" "attempt to either use OpenGL or Vulkan.") -DEF_SWITCH(EnableTxt, - "enable-txt", - "Enable libtxt as the text shaping library instead of Blink.") DEF_SWITCH(FLX, "flx", "Specify the the FLX path.") DEF_SWITCH(Help, "help", "Display this help text.") DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.") diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index e28523a7599fd0af38d196c8b75ed991dd07ffe6..f299a08708f8cee4f4540b730e726ea6d7a7fa34 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -245,9 +245,6 @@ public final class FlutterActivityDelegate if (intent.getBooleanExtra("enable-software-rendering", false)) { args.add("--enable-software-rendering"); } - if (intent.getBooleanExtra("enable-txt", false)) { - args.add("--enable-txt"); - } if (!args.isEmpty()) { String[] argsArray = new String[args.size()]; return args.toArray(argsArray); diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 5402bfb2fbb87f3928842dff7f6b0a0d0cbda6a0..172952f261023b4766ca0e2be99837daf7e6c726 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -9162,7 +9162,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- etc1 -lib observatory_pub_packages skia vulkan diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index e1cb9a48c3148676c69d1863240b60b4f3399d5d..d907d2f71fee4bfb1c26abe6fec3df3e23158869 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -1575,12 +1575,6 @@ 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_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 FILE: ../../../flutter/lib/ui/ui.dart FILE: ../../../flutter/lib/ui/ui_dart_state.cc diff --git a/travis/licenses_golden/licenses_lib b/travis/licenses_golden/licenses_lib index d0f1973f3b381bbaddfb7183505e28cc3a07e2d3..b976e899d023cfebdf3977fd598d2049330c9119 100644 --- a/travis/licenses_golden/licenses_lib +++ b/travis/licenses_golden/licenses_lib @@ -1,4 +1,4 @@ -Signature: 483a21a70cc588d9a999c71e3b537fcb +Signature: 4dcd5e5c7ba17499b85da8a9b3fa6637 UNUSED LICENSES: @@ -47,285 +47,6 @@ or other dealings in this Software without prior written authorization of the copyright holder. ==================================================================================================== -==================================================================================================== -LIBRARY: lib -ORIGIN: ../../../dart/third_party/observatory_pub_packages/packages/quiver/LICENSE -TYPE: LicenseType.apache -FILE: ../../../lib/txt/Android.bp -FILE: ../../../lib/txt/app/Android.bp -FILE: ../../../lib/txt/app/HyphTool.cpp -FILE: ../../../lib/txt/examples/main.cc -FILE: ../../../lib/txt/include/minikin/CmapCoverage.h -FILE: ../../../lib/txt/include/minikin/Emoji.h -FILE: ../../../lib/txt/include/minikin/FontCollection.h -FILE: ../../../lib/txt/include/minikin/FontFamily.h -FILE: ../../../lib/txt/include/minikin/GraphemeBreak.h -FILE: ../../../lib/txt/include/minikin/Hyphenator.h -FILE: ../../../lib/txt/include/minikin/Layout.h -FILE: ../../../lib/txt/include/minikin/LineBreaker.h -FILE: ../../../lib/txt/include/minikin/Measurement.h -FILE: ../../../lib/txt/include/minikin/MinikinFont.h -FILE: ../../../lib/txt/include/minikin/SparseBitSet.h -FILE: ../../../lib/txt/include/minikin/WordBreaker.h -FILE: ../../../lib/txt/libs/minikin/Android.bp -FILE: ../../../lib/txt/libs/minikin/CmapCoverage.cpp -FILE: ../../../lib/txt/libs/minikin/Emoji.cpp -FILE: ../../../lib/txt/libs/minikin/FontCollection.cpp -FILE: ../../../lib/txt/libs/minikin/FontFamily.cpp -FILE: ../../../lib/txt/libs/minikin/FontLanguage.cpp -FILE: ../../../lib/txt/libs/minikin/FontLanguage.h -FILE: ../../../lib/txt/libs/minikin/FontLanguageListCache.cpp -FILE: ../../../lib/txt/libs/minikin/FontLanguageListCache.h -FILE: ../../../lib/txt/libs/minikin/FontUtils.cpp -FILE: ../../../lib/txt/libs/minikin/FontUtils.h -FILE: ../../../lib/txt/libs/minikin/GraphemeBreak.cpp -FILE: ../../../lib/txt/libs/minikin/HbFontCache.cpp -FILE: ../../../lib/txt/libs/minikin/HbFontCache.h -FILE: ../../../lib/txt/libs/minikin/Hyphenator.cpp -FILE: ../../../lib/txt/libs/minikin/Layout.cpp -FILE: ../../../lib/txt/libs/minikin/LayoutUtils.cpp -FILE: ../../../lib/txt/libs/minikin/LayoutUtils.h -FILE: ../../../lib/txt/libs/minikin/LineBreaker.cpp -FILE: ../../../lib/txt/libs/minikin/Measurement.cpp -FILE: ../../../lib/txt/libs/minikin/MinikinFont.cpp -FILE: ../../../lib/txt/libs/minikin/MinikinInternal.cpp -FILE: ../../../lib/txt/libs/minikin/MinikinInternal.h -FILE: ../../../lib/txt/libs/minikin/SparseBitSet.cpp -FILE: ../../../lib/txt/libs/minikin/WordBreaker.cpp -FILE: ../../../lib/txt/shims/log/log.cc -FILE: ../../../lib/txt/shims/log/log.h -FILE: ../../../lib/txt/shims/utils/JenkinsHash.cpp -FILE: ../../../lib/txt/shims/utils/JenkinsHash.h -FILE: ../../../lib/txt/shims/utils/LruCache.h -FILE: ../../../lib/txt/shims/utils/TypeHelpers.h -FILE: ../../../lib/txt/src/font_collection.cc -FILE: ../../../lib/txt/src/font_collection.h -FILE: ../../../lib/txt/src/font_skia.cc -FILE: ../../../lib/txt/src/font_skia.h -FILE: ../../../lib/txt/src/font_style.h -FILE: ../../../lib/txt/src/font_weight.h -FILE: ../../../lib/txt/src/paint_record.cc -FILE: ../../../lib/txt/src/paint_record.h -FILE: ../../../lib/txt/src/paragraph.cc -FILE: ../../../lib/txt/src/paragraph.h -FILE: ../../../lib/txt/src/paragraph_builder.cc -FILE: ../../../lib/txt/src/paragraph_builder.h -FILE: ../../../lib/txt/src/paragraph_constraints.cc -FILE: ../../../lib/txt/src/paragraph_constraints.h -FILE: ../../../lib/txt/src/paragraph_style.cc -FILE: ../../../lib/txt/src/paragraph_style.h -FILE: ../../../lib/txt/src/styled_runs.cc -FILE: ../../../lib/txt/src/styled_runs.h -FILE: ../../../lib/txt/src/text_align.h -FILE: ../../../lib/txt/src/text_baseline.h -FILE: ../../../lib/txt/src/text_decoration.cc -FILE: ../../../lib/txt/src/text_decoration.h -FILE: ../../../lib/txt/src/text_style.cc -FILE: ../../../lib/txt/src/text_style.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: lib ORIGIN: ../../../lib/ftl/LICENSE @@ -670,4 +391,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: 7 +Total license count: 6