Remove build flag ANDROID_ENABLE_RENDERSCRIPT
remove this flag and consider renderscript is always enabled
Bug: 34693640
Test: compile
Change-Id: I22464e1d64f2a55a60ba9f8ab1510f2811605552
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index 692199d..ff40c8a 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -189,13 +189,11 @@
external/harfbuzz_ng/src \
external/freetype/include
-ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
- hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
- hwui_c_includes += \
- $(call intermediates-dir-for,STATIC_LIBRARIES,TARGET,) \
- frameworks/rs/cpp \
- frameworks/rs
-endif
+# enable RENDERSCRIPT
+hwui_c_includes += \
+ $(call intermediates-dir-for,STATIC_LIBRARIES,TARGET,) \
+ frameworks/rs/cpp \
+ frameworks/rs
# ------------------------
# static library
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 4f9a3de..ee99018 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -33,14 +33,11 @@
#include <algorithm>
#include <cutils/properties.h>
+#include <RenderScript.h>
#include <SkGlyph.h>
#include <SkUtils.h>
#include <utils/Log.h>
-#ifdef ANDROID_ENABLE_RENDERSCRIPT
-#include <RenderScript.h>
-#endif
-
namespace android {
namespace uirenderer {
@@ -591,17 +588,12 @@
return image;
}
-#ifdef ANDROID_ENABLE_RENDERSCRIPT
// Align buffers for renderscript usage
if (paddedWidth & (RS_CPU_ALLOCATION_ALIGNMENT - 1)) {
paddedWidth += RS_CPU_ALLOCATION_ALIGNMENT - paddedWidth % RS_CPU_ALLOCATION_ALIGNMENT;
}
int size = paddedWidth * paddedHeight;
uint8_t* dataBuffer = (uint8_t*) memalign(RS_CPU_ALLOCATION_ALIGNMENT, size);
-#else
- int size = paddedWidth * paddedHeight;
- uint8_t* dataBuffer = (uint8_t*) malloc(size);
-#endif
memset(dataBuffer, 0, size);
@@ -691,7 +683,6 @@
void FontRenderer::blurImage(uint8_t** image, int32_t width, int32_t height, float radius) {
uint32_t intRadius = Blur::convertRadiusToInt(radius);
-#ifdef ANDROID_ENABLE_RENDERSCRIPT
if (width * height * intRadius >= RS_MIN_INPUT_CUTOFF && radius <= 25.0f) {
uint8_t* outImage = (uint8_t*) memalign(RS_CPU_ALLOCATION_ALIGNMENT, width * height);
@@ -729,7 +720,6 @@
return;
}
}
-#endif
std::unique_ptr<float[]> gaussian(new float[2 * intRadius + 1]);
Blur::generateGaussianWeights(gaussian.get(), radius);
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index dd9c40f..329309c 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -34,7 +34,6 @@
#include <vector>
-#ifdef ANDROID_ENABLE_RENDERSCRIPT
#include "RenderScript.h"
namespace RSC {
class Element;
@@ -42,7 +41,6 @@
class ScriptIntrinsicBlur;
class sp;
}
-#endif
namespace android {
namespace uirenderer {
@@ -201,12 +199,10 @@
FontCacheHistoryTracker mHistoryTracker;
#endif
-#ifdef ANDROID_ENABLE_RENDERSCRIPT
// RS constructs
RSC::sp<RSC::RS> mRs;
RSC::sp<const RSC::Element> mRsElement;
RSC::sp<RSC::ScriptIntrinsicBlur> mRsScript;
-#endif
static void computeGaussianWeights(float* weights, int32_t radius);
static void horizontalBlur(float* weights, int32_t radius, const uint8_t *source, uint8_t *dest,
diff --git a/libs/hwui/hwui_static_deps.mk b/libs/hwui/hwui_static_deps.mk
index f69da48..a75fd6a 100644
--- a/libs/hwui/hwui_static_deps.mk
+++ b/libs/hwui/hwui_static_deps.mk
@@ -28,6 +28,5 @@
libminikin \
libandroidfw
-ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
- LOCAL_SHARED_LIBRARIES += libRScpp
-endif
+# enable RENDERSCRIPT
+LOCAL_SHARED_LIBRARIES += libRScpp