summaryrefslogtreecommitdiff
path: root/libs/hwui/FontRenderer.cpp
diff options
context:
space:
mode:
author Po-Chien Hsueh <pchsueh@google.com> 2017-02-09 10:38:34 +0800
committer Po-Chien Hsueh <pchsueh@google.com> 2017-02-09 15:00:09 +0800
commitc5ae595e6f71798109c730cd835a2cca79a8877c (patch)
treea228eb79eb5003000262b29c28ed67e67844ae56 /libs/hwui/FontRenderer.cpp
parent47c4c94100e1ec861d2c2593ad66ba050bbe93fe (diff)
Remove build flag ANDROID_ENABLE_RENDERSCRIPT
remove this flag and consider renderscript is always enabled Bug: 34693640 Test: compile Change-Id: I22464e1d64f2a55a60ba9f8ab1510f2811605552
Diffstat (limited to 'libs/hwui/FontRenderer.cpp')
-rw-r--r--libs/hwui/FontRenderer.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 4f9a3de64fc2..ee99018fb652 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 @@ FontRenderer::DropShadow FontRenderer::renderDropShadow(const SkPaint* paint, co
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 @@ bool FontRenderer::renderTextOnPath(const SkPaint* paint, const Rect* clip, cons
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 @@ void FontRenderer::blurImage(uint8_t** image, int32_t width, int32_t height, flo
return;
}
}
-#endif
std::unique_ptr<float[]> gaussian(new float[2 * intRadius + 1]);
Blur::generateGaussianWeights(gaussian.get(), radius);