Fix compilation with "skia_enable_skparagraph = false"

Change-Id: I034d841618fbf878223c82ec30f0ad37678d737e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443899
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2021-08-31 12:36:25 -04:00 committed by SkCQ
parent 0e32aa8a3a
commit be2c3ee05d
4 changed files with 13 additions and 0 deletions

View File

@ -12,6 +12,8 @@
#include "include/core/SkString.h"
#include "tools/Resources.h"
#if defined(SK_ENABLE_PARAGRAPH)
#include "modules/skparagraph/include/FontCollection.h"
#include "modules/skparagraph/include/ParagraphBuilder.h"
#include "modules/skparagraph/include/ParagraphStyle.h"
@ -92,3 +94,5 @@ private:
};
DEF_BENCH( return new ParagraphBench; )
#endif // SK_ENABLE_PARAGRAPH

View File

@ -52,6 +52,8 @@
#include <utility>
#include <vector>
#if defined(SK_ENABLE_PARAGRAPH)
using namespace skia::textlayout;
namespace {
const uint8_t MAX_TEXT_LENGTH = 255;
@ -280,3 +282,5 @@ DEF_FUZZ(SkParagraph, fuzz) {
paragraph->layout(layout_width);
paragraph->paint(&canvas, 0, 0);
}
#endif // SK_ENABLE_PARAGRAPH

View File

@ -7,6 +7,8 @@
#include "fuzz/Fuzz.h"
#if defined(SK_ENABLE_PARAGRAPH)
void fuzz_SkParagraph(Fuzz* f);
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
@ -17,3 +19,5 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
fuzz_SkParagraph(&fuzz);
return 0;
}
#endif

View File

@ -13,6 +13,7 @@ declare_args() {
if (skia_enable_skparagraph && skia_enable_skshaper && skia_use_icu &&
skia_use_harfbuzz) {
config("public_config") {
defines = [ "SK_ENABLE_PARAGRAPH" ]
include_dirs = [
"include",
"utils",