skia2/include
Leon Scroggins III c41a5f58b2 Generate Android Framework host-side Skia (linux)
Bug: b/118742766

Update gn_to_bp to write an Android.bp file that will build a host-side
Skia library.

Switch some methods from SK_BUILD_FOR_ANDROID to
SK_BUILD_FOR_ANDROID_FRAMEWORK.

Prior reviews were done at ag/5482397.

gn_to_bp.py:
- Run GN twice - once for android and once for linux
- Disable GPU (depends on a to-be-written host side GL target) and HEIF
  (which relies on Android hardware) on linux
  - TODO: Turn on GPU on linux
- Split sources into everywhere, android-only, and linux-only.
  It seems that Android.bp does not allow using the same cpp
  file in multiple targets.
  - note that we currently *only* divide out the sources. The cflags are
    the same (except for a couple manual ones) and include
    directories are mostly the same (again, except for manual ones).
    Android has a "gpu" include directory, which I don't expect to
    make a difference to the linux build, which isn't using GPU (yet).
- Use the same "custom empty" font manager on the host as on Android
- Write separate SkUserConfig files; one for android and one for linux.
  This allows libskia to force libraries that use it to use the right
  defines by setting export_include_dirs.
- Add extra checks to SkUserConfig.h to ensure we have only the
  appropriate SK_BUILD_FOR macro defined
- Add host_supported: true for libskia

gn_to_bp_utils.py:
- Switch SkUserConfig.h from include guards to pragma once so it is
  easier to append to the end. This matches how Android generally
  includes headers.

BUILD.gn:
- Add skia_use_fixed_gamma_text so host build can use the same SK_GAMMA
  defines as the device.

SkPreConfig.h:
- Stop making SK_BUILD_FOR_ANDROID_FRAMEWORK imply SK_BUILD_FOR_ANDROID.
  The host build needs the former defined but not the latter.

SkRegion.cpp/.h:
- Make toString() SK_BUILD_FOR_ANDROID_FRAMEWORK so it can be called on
  the host.

SkCamera.h/.cpp:
- Switch methods to SK_BUILD_FOR_ANDROID_FRAMEWORK so they can be called
  on the host.
- Make getCameraLocation*() const. They are logically const, and this
  allows removing a const_cast + TODO in hwui.

Change-Id: I771f825d06380e01c0488fd1c00df1d8a2454dc0
Reviewed-on: https://skia-review.googlesource.com/c/171231
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-19 17:51:32 +00:00
..
android Add SafetyNetLogging and use in SkPngCodec 2018-11-14 20:06:03 +00:00
atlastext include: whitespace changes for clang-format 2018-09-19 14:54:57 +00:00
c expand imageinfo in C api, start on colorspace 2018-09-28 17:52:59 +00:00
codec Revert "remove old name for SkCodec::kNoFrame" 2018-11-12 16:26:04 +00:00
config remove unused parts of SkTypes.h 2018-06-08 23:53:57 +00:00
core Generate Android Framework host-side Skia (linux) 2018-11-19 17:51:32 +00:00
docs Add initial support for generating tagged PDFs. 2018-09-27 19:35:40 +00:00
effects Remove unused exposedInAndroidJavaAPI 2018-11-12 21:27:02 +00:00
encode Move SkNoncopyable to include/private. 2018-07-17 21:39:51 +00:00
gpu Add flag to force purge resources from cache as soon as possible. 2018-11-15 16:45:30 +00:00
pathops fixup winding contours 2018-08-17 14:01:51 +00:00
ports SkImageGeneratorCG.h to only expose factory method. 2018-09-19 21:20:35 +00:00
private Add helpers to deal with byte vs. half-float vertex colors 2018-11-19 17:32:39 +00:00
svg Add a SkWStream-based SkSVGCanvas factory 2017-09-19 20:33:19 +00:00
utils Generate Android Framework host-side Skia (linux) 2018-11-19 17:51:32 +00:00