Merge "Isolate the graphics classes into their own static lib"
This commit is contained in:
committed by
Android (Google) Code Review
commit
7bdc19bacb
@@ -33,46 +33,10 @@ cc_library_shared {
|
||||
|
||||
srcs: [
|
||||
"android_animation_PropertyValuesHolder.cpp",
|
||||
"android_graphics_Canvas.cpp",
|
||||
"android_graphics_ColorSpace.cpp",
|
||||
"android_graphics_drawable_AnimatedVectorDrawable.cpp",
|
||||
"android_graphics_drawable_VectorDrawable.cpp",
|
||||
"android_graphics_Picture.cpp",
|
||||
"android_nio_utils.cpp",
|
||||
"android_os_SystemClock.cpp",
|
||||
"android_os_SystemProperties.cpp",
|
||||
"android_util_EventLog.cpp",
|
||||
"android_util_Log.cpp",
|
||||
"android_util_PathParser.cpp",
|
||||
"android_view_DisplayListCanvas.cpp",
|
||||
"android_view_RenderNode.cpp",
|
||||
"android/graphics/Bitmap.cpp",
|
||||
"android/graphics/BitmapFactory.cpp",
|
||||
"android/graphics/ByteBufferStreamAdaptor.cpp",
|
||||
"android/graphics/ColorFilter.cpp",
|
||||
"android/graphics/CreateJavaOutputStreamAdaptor.cpp",
|
||||
"android/graphics/FontFamily.cpp",
|
||||
"android/graphics/FontUtils.cpp",
|
||||
"android/graphics/Graphics.cpp",
|
||||
"android/graphics/ImageDecoder.cpp",
|
||||
"android/graphics/MaskFilter.cpp",
|
||||
"android/graphics/Matrix.cpp",
|
||||
"android/graphics/NinePatch.cpp",
|
||||
"android/graphics/NinePatchPeeker.cpp",
|
||||
"android/graphics/Paint.cpp",
|
||||
"android/graphics/PaintFilter.cpp",
|
||||
"android/graphics/Path.cpp",
|
||||
"android/graphics/PathEffect.cpp",
|
||||
"android/graphics/PathMeasure.cpp",
|
||||
"android/graphics/Picture.cpp",
|
||||
"android/graphics/Region.cpp",
|
||||
"android/graphics/Shader.cpp",
|
||||
"android/graphics/Typeface.cpp",
|
||||
"android/graphics/Utils.cpp",
|
||||
"android/graphics/fonts/Font.cpp",
|
||||
"android/graphics/fonts/FontFamily.cpp",
|
||||
"android/graphics/text/LineBreaker.cpp",
|
||||
"android/graphics/text/MeasuredText.cpp",
|
||||
"com_android_internal_util_VirtualRefBasePtr.cpp",
|
||||
"com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp",
|
||||
],
|
||||
@@ -83,21 +47,23 @@ cc_library_shared {
|
||||
"bionic/libc/private",
|
||||
|
||||
"external/skia/include/private",
|
||||
"external/skia/src/codec",
|
||||
"external/skia/src/core",
|
||||
"external/skia/src/effects",
|
||||
"external/skia/src/image",
|
||||
"external/skia/src/images",
|
||||
"frameworks/base/media/jni",
|
||||
"system/media/camera/include",
|
||||
"system/media/private/camera/include",
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
"libandroid_graphics",
|
||||
],
|
||||
|
||||
whole_static_libs: ["libandroid_graphics"],
|
||||
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libcutils",
|
||||
"libharfbuzz_ng",
|
||||
"libhwui",
|
||||
"libjpeg",
|
||||
"liblog",
|
||||
"libminikin",
|
||||
"libnativehelper",
|
||||
@@ -105,7 +71,6 @@ cc_library_shared {
|
||||
"libziparchive",
|
||||
],
|
||||
|
||||
local_include_dirs: ["android/graphics"],
|
||||
export_include_dirs: [
|
||||
".",
|
||||
"include",
|
||||
@@ -141,7 +106,6 @@ cc_library_shared {
|
||||
"android_database_SQLiteDebug.cpp",
|
||||
"android_view_CompositionSamplingListener.cpp",
|
||||
"android_view_DisplayEventReceiver.cpp",
|
||||
"android_view_TextureLayer.cpp",
|
||||
"android_view_InputChannel.cpp",
|
||||
"android_view_InputDevice.cpp",
|
||||
"android_view_InputEventReceiver.cpp",
|
||||
@@ -157,7 +121,6 @@ cc_library_shared {
|
||||
"android_view_SurfaceControl.cpp",
|
||||
"android_view_SurfaceSession.cpp",
|
||||
"android_view_TextureView.cpp",
|
||||
"android_view_ThreadedRenderer.cpp",
|
||||
"android_view_VelocityTracker.cpp",
|
||||
"android_text_AndroidCharacter.cpp",
|
||||
"android_text_Hyphenator.cpp",
|
||||
@@ -188,21 +151,6 @@ cc_library_shared {
|
||||
"android_util_StringBlock.cpp",
|
||||
"android_util_XmlBlock.cpp",
|
||||
"android_util_jar_StrictJarFile.cpp",
|
||||
"android/graphics/AnimatedImageDrawable.cpp",
|
||||
"android/graphics/Camera.cpp",
|
||||
"android/graphics/CanvasProperty.cpp",
|
||||
"android/graphics/GIFMovie.cpp",
|
||||
"android/graphics/GraphicBuffer.cpp",
|
||||
"android/graphics/Interpolator.cpp",
|
||||
"android/graphics/Movie.cpp",
|
||||
"android/graphics/MovieImpl.cpp",
|
||||
"android/graphics/BitmapRegionDecoder.cpp",
|
||||
"android/graphics/SurfaceTexture.cpp",
|
||||
"android/graphics/YuvToJpegEncoder.cpp",
|
||||
"android/graphics/pdf/PdfDocument.cpp",
|
||||
"android/graphics/pdf/PdfEditor.cpp",
|
||||
"android/graphics/pdf/PdfRenderer.cpp",
|
||||
"android/graphics/pdf/PdfUtils.cpp",
|
||||
"android_media_AudioEffectDescriptor.cpp",
|
||||
"android_media_AudioRecord.cpp",
|
||||
"android_media_AudioSystem.cpp",
|
||||
@@ -302,7 +250,6 @@ cc_library_shared {
|
||||
"libmeminfo",
|
||||
"libaudioclient",
|
||||
"libaudiopolicy",
|
||||
"libjpeg",
|
||||
"libusbhost",
|
||||
"libpdfium",
|
||||
"libimg_utils",
|
||||
@@ -328,9 +275,6 @@ cc_library_shared {
|
||||
|
||||
// our headers include libnativewindow's public headers
|
||||
"libnativewindow",
|
||||
|
||||
// GraphicsJNI.h includes hwui headers
|
||||
"libhwui",
|
||||
],
|
||||
generated_sources: ["android_util_StatsLogInternal.cpp"],
|
||||
},
|
||||
@@ -367,3 +311,140 @@ cc_library_shared {
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
cc_library_static {
|
||||
name: "libandroid_graphics",
|
||||
host_supported: true,
|
||||
cflags: [
|
||||
"-Wno-unused-parameter",
|
||||
"-Wno-non-virtual-dtor",
|
||||
"-Wno-maybe-uninitialized",
|
||||
"-Wno-parentheses",
|
||||
|
||||
"-DGL_GLEXT_PROTOTYPES",
|
||||
"-DEGL_EGLEXT_PROTOTYPES",
|
||||
|
||||
"-DU_USING_ICU_NAMESPACE=0",
|
||||
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
"-Wno-error=deprecated-declarations",
|
||||
"-Wunused",
|
||||
"-Wunreachable-code",
|
||||
],
|
||||
|
||||
cppflags: ["-Wno-conversion-null"],
|
||||
|
||||
srcs: [
|
||||
"android_graphics_Canvas.cpp",
|
||||
"android_graphics_ColorSpace.cpp",
|
||||
"android_graphics_drawable_AnimatedVectorDrawable.cpp",
|
||||
"android_graphics_drawable_VectorDrawable.cpp",
|
||||
"android_graphics_Picture.cpp",
|
||||
"android_nio_utils.cpp",
|
||||
"android_view_DisplayListCanvas.cpp",
|
||||
"android_view_RenderNode.cpp",
|
||||
"android_util_PathParser.cpp",
|
||||
|
||||
"android/graphics/AnimatedImageDrawable.cpp",
|
||||
"android/graphics/Bitmap.cpp",
|
||||
"android/graphics/BitmapFactory.cpp",
|
||||
"android/graphics/ByteBufferStreamAdaptor.cpp",
|
||||
"android/graphics/Camera.cpp",
|
||||
"android/graphics/CanvasProperty.cpp",
|
||||
"android/graphics/ColorFilter.cpp",
|
||||
"android/graphics/CreateJavaOutputStreamAdaptor.cpp",
|
||||
"android/graphics/FontFamily.cpp",
|
||||
"android/graphics/FontUtils.cpp",
|
||||
"android/graphics/Graphics.cpp",
|
||||
"android/graphics/ImageDecoder.cpp",
|
||||
"android/graphics/Interpolator.cpp",
|
||||
"android/graphics/MaskFilter.cpp",
|
||||
"android/graphics/Matrix.cpp",
|
||||
"android/graphics/NinePatch.cpp",
|
||||
"android/graphics/NinePatchPeeker.cpp",
|
||||
"android/graphics/Paint.cpp",
|
||||
"android/graphics/PaintFilter.cpp",
|
||||
"android/graphics/Path.cpp",
|
||||
"android/graphics/PathEffect.cpp",
|
||||
"android/graphics/PathMeasure.cpp",
|
||||
"android/graphics/Picture.cpp",
|
||||
"android/graphics/Region.cpp",
|
||||
"android/graphics/Shader.cpp",
|
||||
"android/graphics/Typeface.cpp",
|
||||
"android/graphics/Utils.cpp",
|
||||
"android/graphics/YuvToJpegEncoder.cpp",
|
||||
"android/graphics/fonts/Font.cpp",
|
||||
"android/graphics/fonts/FontFamily.cpp",
|
||||
"android/graphics/text/LineBreaker.cpp",
|
||||
"android/graphics/text/MeasuredText.cpp",
|
||||
],
|
||||
|
||||
local_include_dirs: [
|
||||
"include", // NEEDED FOR ANDROID RUNTIME
|
||||
"android/graphics",
|
||||
],
|
||||
|
||||
export_include_dirs: [
|
||||
".",
|
||||
],
|
||||
|
||||
include_dirs: [
|
||||
"external/skia/include/private",
|
||||
"external/skia/src/codec",
|
||||
"external/skia/src/core",
|
||||
"external/skia/src/effects",
|
||||
"external/skia/src/image",
|
||||
"external/skia/src/images",
|
||||
],
|
||||
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libcutils",
|
||||
"libharfbuzz_ng",
|
||||
"libhwui",
|
||||
"liblog",
|
||||
"libminikin",
|
||||
"libnativehelper",
|
||||
"libz",
|
||||
"libziparchive",
|
||||
"libjpeg",
|
||||
],
|
||||
|
||||
target: {
|
||||
android: {
|
||||
srcs: [ // sources that depend on android only libraries
|
||||
"android_view_TextureLayer.cpp",
|
||||
"android_view_ThreadedRenderer.cpp",
|
||||
"android/graphics/BitmapRegionDecoder.cpp",
|
||||
"android/graphics/GIFMovie.cpp",
|
||||
"android/graphics/GraphicBuffer.cpp",
|
||||
"android/graphics/Movie.cpp",
|
||||
"android/graphics/MovieImpl.cpp",
|
||||
"android/graphics/SurfaceTexture.cpp",
|
||||
"android/graphics/pdf/PdfDocument.cpp",
|
||||
"android/graphics/pdf/PdfEditor.cpp",
|
||||
"android/graphics/pdf/PdfRenderer.cpp",
|
||||
"android/graphics/pdf/PdfUtils.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"libandroidfw",
|
||||
"libnativewindow",
|
||||
"libgui",
|
||||
"libpdfium",
|
||||
],
|
||||
static_libs: [
|
||||
"libgif",
|
||||
],
|
||||
},
|
||||
host: {
|
||||
cflags: [
|
||||
"-Wno-unused-const-variable",
|
||||
"-Wno-unused-function",
|
||||
],
|
||||
static_libs: [
|
||||
"libandroidfw",
|
||||
],
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <nativehelper/JNIHelp.h>
|
||||
|
||||
#include "android_os_Parcel.h"
|
||||
#include "android/graphics/GraphicsJNI.h"
|
||||
#include "android/graphics/GraphicBuffer.h"
|
||||
|
||||
#include <android/hardware_buffer.h>
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "android_os_Parcel.h"
|
||||
#include "android_view_MotionEvent.h"
|
||||
#include "android_util_Binder.h"
|
||||
#include "android/graphics/Matrix.h"
|
||||
|
||||
#include "core_jni_helpers.h"
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
|
||||
namespace android {
|
||||
|
||||
static const char* const OutOfResourcesException =
|
||||
"android/view/Surface$OutOfResourcesException";
|
||||
static const char* const IllegalArgumentException = "java/lang/IllegalArgumentException";
|
||||
static const char* const OutOfResourcesException = "android/view/Surface$OutOfResourcesException";
|
||||
|
||||
static struct {
|
||||
jclass clazz;
|
||||
@@ -155,7 +155,7 @@ static jlong nativeCreateFromSurfaceTexture(JNIEnv* env, jclass clazz,
|
||||
jobject surfaceTextureObj) {
|
||||
sp<IGraphicBufferProducer> producer(SurfaceTexture_getProducer(env, surfaceTextureObj));
|
||||
if (producer == NULL) {
|
||||
jniThrowException(env, "java/lang/IllegalArgumentException",
|
||||
jniThrowException(env, IllegalArgumentException,
|
||||
"SurfaceTexture has already been released");
|
||||
return 0;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ static jboolean nativeIsValid(JNIEnv* env, jclass clazz, jlong nativeObject) {
|
||||
static jboolean nativeIsConsumerRunningBehind(JNIEnv* env, jclass clazz, jlong nativeObject) {
|
||||
sp<Surface> sur(reinterpret_cast<Surface *>(nativeObject));
|
||||
if (!isSurfaceValid(sur)) {
|
||||
doThrowIAE(env);
|
||||
jniThrowException(env, IllegalArgumentException, NULL);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
int value = 0;
|
||||
@@ -212,7 +212,7 @@ static jlong nativeLockCanvas(JNIEnv* env, jclass clazz,
|
||||
sp<Surface> surface(reinterpret_cast<Surface *>(nativeObject));
|
||||
|
||||
if (!isSurfaceValid(surface)) {
|
||||
doThrowIAE(env);
|
||||
jniThrowException(env, IllegalArgumentException, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ static void nativeUnlockCanvasAndPost(JNIEnv* env, jclass clazz,
|
||||
// unlock surface
|
||||
status_t err = surface->unlockAndPost();
|
||||
if (err < 0) {
|
||||
doThrowIAE(env);
|
||||
jniThrowException(env, IllegalArgumentException, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ static jlong nativeReadFromParcel(JNIEnv* env, jclass clazz,
|
||||
jlong nativeObject, jobject parcelObj) {
|
||||
Parcel* parcel = parcelForJavaObject(env, parcelObj);
|
||||
if (parcel == NULL) {
|
||||
doThrowNPE(env);
|
||||
jniThrowNullPointerException(env, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ static void nativeWriteToParcel(JNIEnv* env, jclass clazz,
|
||||
jlong nativeObject, jobject parcelObj) {
|
||||
Parcel* parcel = parcelForJavaObject(env, parcelObj);
|
||||
if (parcel == NULL) {
|
||||
doThrowNPE(env);
|
||||
jniThrowNullPointerException(env, NULL);
|
||||
return;
|
||||
}
|
||||
sp<Surface> self(reinterpret_cast<Surface *>(nativeObject));
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "android_os_Parcel.h"
|
||||
#include "android_util_Binder.h"
|
||||
#include "android_hardware_input_InputWindowHandle.h"
|
||||
#include "android/graphics/Bitmap.h"
|
||||
#include "android/graphics/Region.h"
|
||||
#include "core_jni_helpers.h"
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "Debug.h"
|
||||
#include "TreeInfo.h"
|
||||
#include "VectorDrawable.h"
|
||||
#include "private/hwui/WebViewFunctor.h"
|
||||
#ifdef __ANDROID__
|
||||
#include "renderthread/CanvasContext.h"
|
||||
#else
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "SkiaDisplayList.h"
|
||||
#include "FunctorDrawable.h"
|
||||
|
||||
#include "DumpOpsCanvas.h"
|
||||
#ifdef __ANDROID__ // Layoutlib does not support SkiaPipeline
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FunctorDrawable.h"
|
||||
#include "RecordingCanvas.h"
|
||||
#include "RenderNodeDrawable.h"
|
||||
#include "TreeInfo.h"
|
||||
@@ -34,6 +33,7 @@ class CanvasContext;
|
||||
}
|
||||
|
||||
class Outline;
|
||||
struct WebViewSyncData;
|
||||
|
||||
namespace VectorDrawable {
|
||||
class Tree;
|
||||
@@ -42,6 +42,8 @@ typedef uirenderer::VectorDrawable::Tree VectorDrawableRoot;
|
||||
|
||||
namespace skiapipeline {
|
||||
|
||||
class FunctorDrawable;
|
||||
|
||||
class SkiaDisplayList {
|
||||
public:
|
||||
size_t getUsedSize() { return allocator.usedSize() + mDisplayList.usedSize(); }
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "Frame.h"
|
||||
#include "IRenderPipeline.h"
|
||||
#include "VulkanSurface.h"
|
||||
#include "private/hwui/DrawVkInfo.h"
|
||||
|
||||
class GrVkExtensions;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user