Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96bf4b2f authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Make Bitmap.cpp use aconfig flags on host side too

Fix: 403462359
Test: atest CtsGraphicsTestCasesRavenwood:android.graphics.cts.BitmapTest
(and treehugger)
Flag: EXEMPT host side change only

Change-Id: I0d229a1edbd302ec770c62ccce9c298ba99acbea
parent fa3aaa18
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -488,6 +488,7 @@ cc_library_shared_for_libandroid_runtime {
                "libbinder",
                "libbinder_ndk",
                "libhidlbase", // libhwbinder is in here
                "libaconfig_storage_read_api_cc",
            ],
            version_script: "platform/linux/libandroid_runtime_export.txt",
        },
+8 −0
Original line number Diff line number Diff line
@@ -168,6 +168,14 @@ cc_defaults {
                "libutils",
            ],
        },
        host_linux: {
            shared_libs: [
                "libaconfig_storage_read_api_cc",
            ],
            whole_static_libs: [
                "hwui_flags_cc_lib",
            ],
        },
    },
}

+4 −10
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
#include "Bitmap.h"

#include <android-base/unique_fd.h>
#ifdef __linux__
#include <com_android_graphics_hwui_flags.h>
#endif
#include <hwui/Bitmap.h>
#include <hwui/Paint.h>
#include <inttypes.h>
@@ -33,15 +36,6 @@
#endif
#include "android_nio_utils.h"

#ifdef __ANDROID__
#include <com_android_graphics_hwui_flags.h>
namespace hwui_flags = com::android::graphics::hwui::flags;
#else
namespace hwui_flags {
constexpr bool bitmap_parcel_ashmem_as_immutable() { return false; }
}
#endif

#define DEBUG_PARCEL 0

static jclass   gBitmap_class;
@@ -861,7 +855,7 @@ static bool shouldParcelAsMutable(SkBitmap& bitmap, AParcel* parcel) {
        return false;
    }

    if (!hwui_flags::bitmap_parcel_ashmem_as_immutable()) {
    if (!com::android::graphics::hwui::flags::bitmap_parcel_ashmem_as_immutable()) {
        return true;
    }