skia2/include/utils
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
..
mac Make SkImageGeneratorCG apply encoded origin 2017-11-03 15:29:34 +00:00
Sk3D.h SkAR: drawing text, shapes, rotation modes enabled, translating objects 2018-06-19 19:10:54 +00:00
SkAnimCodecPlayer.h play with animated gif 2018-10-03 14:43:18 +00:00
SkBase64.h make includes available for flutter 2018-06-21 18:12:47 +00:00
SkCamera.h Generate Android Framework host-side Skia (linux) 2018-11-19 17:51:32 +00:00
SkCanvasStateUtils.h no need for SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT anymore 2016-12-07 22:28:04 +00:00
SkEventTracer.h Add category support to JSON and SkDebugf tracing 2017-07-21 16:38:23 +00:00
SkFrontBufferedStream.h Add SK_API to APIs used by the android framework. 2017-09-21 18:14:36 +00:00
SkInterpolator.h Move SkNoncopyable to include/private. 2018-07-17 21:39:51 +00:00
SkLua.h Convert NULL and 0 to nullptr. 2017-08-28 17:48:57 +00:00
SkLuaCanvas.h don't support virtual onDrawTextOnPath 2018-08-28 16:54:18 +00:00
SkNoDrawCanvas.h Revert "Revert "Add experimental API to draw a set of SkImages in one SkCanvas call."" 2018-10-12 16:09:21 +00:00
SkNullCanvas.h no need for SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT anymore 2016-12-07 22:28:04 +00:00
SkNWayCanvas.h Revert "Revert "Add experimental API to draw a set of SkImages in one SkCanvas call."" 2018-10-12 16:09:21 +00:00
SkPaintFilterCanvas.h Revert "Revert "Add experimental API to draw a set of SkImages in one SkCanvas call."" 2018-10-12 16:09:21 +00:00
SkParse.h remove unused parts of SkTypes.h 2018-06-08 23:53:57 +00:00
SkParsePath.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkRandom.h remove SkRandom::next64() 2018-09-06 12:46:46 +00:00
SkShadowUtils.h Remove deprecated drawShadow interfaces 2018-02-28 19:07:29 +00:00
SkTextUtils.h hide the SkPaint::Align enum entirely 2018-10-30 17:26:47 +00:00
SkTraceEventPhase.h make includes available for flutter 2018-06-21 18:12:47 +00:00