| load("//bazel:flags.bzl", "bool_flag", "selects") |
| load("//bazel:skia_rules.bzl", "exports_files_legacy", "generate_cpp_files_for_headers", "skia_cc_deps", "skia_cc_library", "skia_filegroup", "split_srcs_and_hdrs") |
| |
| package( |
| default_applicable_licenses = ["//:license"], |
| ) |
| |
| licenses(["notice"]) |
| |
| exports_files_legacy() |
| |
| PDF_FILES = [ |
| "SkBitmapKey.h", |
| "SkClusterator.cpp", |
| "SkClusterator.h", |
| "SkDeflate.cpp", |
| "SkDeflate.h", |
| "SkKeyedImage.cpp", |
| "SkKeyedImage.h", |
| "SkPDFBitmap.cpp", |
| "SkPDFBitmap.h", |
| "SkPDFDevice.cpp", |
| "SkPDFDevice.h", |
| "SkPDFDocument.cpp", |
| "SkPDFDocumentPriv.h", |
| "SkPDFFont.cpp", |
| "SkPDFFont.h", |
| "SkPDFFormXObject.cpp", |
| "SkPDFFormXObject.h", |
| "SkPDFGlyphUse.h", |
| "SkPDFGradientShader.cpp", |
| "SkPDFGradientShader.h", |
| "SkPDFGraphicStackState.cpp", |
| "SkPDFGraphicStackState.h", |
| "SkPDFGraphicState.cpp", |
| "SkPDFGraphicState.h", |
| "SkPDFMakeCIDGlyphWidthsArray.cpp", |
| "SkPDFMakeCIDGlyphWidthsArray.h", |
| "SkPDFMakeToUnicodeCmap.cpp", |
| "SkPDFMakeToUnicodeCmap.h", |
| "SkPDFMetadata.cpp", |
| "SkPDFMetadata.h", |
| "SkPDFResourceDict.cpp", |
| "SkPDFResourceDict.h", |
| "SkPDFShader.cpp", |
| "SkPDFShader.h", |
| "SkPDFSubsetFont.cpp", |
| "SkPDFSubsetFont.h", |
| "SkPDFTag.cpp", |
| "SkPDFTag.h", |
| "SkPDFType1Font.cpp", |
| "SkPDFType1Font.h", |
| "SkPDFTypes.cpp", |
| "SkPDFTypes.h", |
| "SkPDFUnion.h", |
| "SkPDFUtils.cpp", |
| "SkPDFUtils.h", |
| "SkUUID.h", |
| ] |
| |
| split_srcs_and_hdrs( |
| name = "_pdf", |
| files = PDF_FILES, |
| ) |
| |
| #TODO: remove after Chromium no longer references this. |
| skia_filegroup( |
| name = "jpeg_info_libjpeg", |
| srcs = ["SkJpegInfo_libjpegturbo.cpp"], |
| ) |
| |
| #TODO: remove after Chromium no longer references this. |
| skia_filegroup( |
| name = "jpeg_info_none", |
| srcs = ["SkJpegInfo_none.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "srcs", |
| srcs = [ |
| ":_pdf_srcs", |
| ], |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "private_hdrs", |
| srcs = [ |
| ":_pdf_hdrs", |
| ], |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| bool_flag( |
| name = "enable_pdf_backend", |
| default = False, |
| ) |
| |
| bool_flag( |
| name = "enable_pdf_subset_harfbuzz", |
| default = True, # This defaults it to be on if icu and harfbuzz are on |
| ) |
| |
| selects.config_setting_group( |
| name = "uses_harfbuzz", |
| match_all = [ |
| "//bazel/common_config_settings:use_icu_true", |
| "//bazel/common_config_settings:use_harfbuzz_true", |
| ":enable_pdf_subset_harfbuzz_true", |
| ], |
| ) |
| |
| # TODO(kjlubick) delete after pdf backend is modularized |
| skia_cc_library( |
| name = "legacy_harfbuzz", |
| deps = ["@harfbuzz"], |
| ) |
| |
| skia_cc_deps( |
| name = "deps", |
| visibility = ["//src:__pkg__"], |
| deps = [ |
| "@zlib_skia//:zlib", |
| #"//src/codec:jpeg_decode", |
| #"//src/encode:jpeg_encode", |
| ] + select({ |
| ":uses_harfbuzz": [":legacy_harfbuzz"], |
| "//conditions:default": [], |
| }), |
| ) |
| |
| generate_cpp_files_for_headers( |
| name = "headers_to_compile", |
| headers = [ |
| "SkBitmapKey.h", |
| "SkPDFDocumentPriv.h", |
| "SkPDFUnion.h", |
| "SkUUID.h", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "pdf", |
| srcs = [ |
| ":_pdf_hdrs", |
| ":_pdf_srcs", |
| ], |
| hdrs = [ |
| "//include/docs:pdf_hdrs", |
| ], |
| local_defines = ["SK_PDF_USE_HARFBUZZ_SUBSET"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| "//:core", |
| "//:jpeg_decode_codec", |
| "//:jpeg_encode_codec", |
| "//:pathops", |
| "//src/core:core_priv", |
| "//src/utils:clip_stack_utils", |
| "//src/utils:float_to_decimal", |
| "@zlib_skia//:zlib", |
| ] + |
| # We have this harfbuzz dependency all by itself because we need to turn this into a |
| # select statement when rolling into G3. |
| [ |
| "@harfbuzz", |
| ], |
| ) |