• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2017 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "paragraph_builder.h"
18 #include "paragraph_builder_txt.h"
19 #include "paragraph_style.h"
20 #include "third_party/icu/source/common/unicode/unistr.h"
21 
22 #if FLUTTER_ENABLE_SKSHAPER
23 #include "flutter/third_party/txt/src/skia/paragraph_builder_skia.h"
24 #endif
25 
26 namespace txt {
27 
CreateTxtBuilder(const ParagraphStyle & style,std::shared_ptr<FontCollection> font_collection)28 std::unique_ptr<ParagraphBuilder> ParagraphBuilder::CreateTxtBuilder(
29     const ParagraphStyle& style,
30     std::shared_ptr<FontCollection> font_collection) {
31   return std::make_unique<ParagraphBuilderTxt>(style, font_collection);
32 }
33 
34 #if FLUTTER_ENABLE_SKSHAPER
35 
CreateSkiaBuilder(const ParagraphStyle & style,std::shared_ptr<FontCollection> font_collection)36 std::unique_ptr<ParagraphBuilder> ParagraphBuilder::CreateSkiaBuilder(
37     const ParagraphStyle& style,
38     std::shared_ptr<FontCollection> font_collection) {
39   return std::make_unique<ParagraphBuilderSkia>(style, font_collection);
40 }
41 
42 #endif  // FLUTTER_ENABLE_SKSHAPER
43 
44 }  // namespace txt
45