From 250b1cfc831fd2a271c09cab547efcc5e3d5f828 Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Thu, 1 Aug 2013 14:49:22 -0700 Subject: Handle updates to RS C++ API. Change-Id: I73127fc7369643b94d4a49f31a516b50c74b54ac --- libs/hwui/FontRenderer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'libs/hwui/FontRenderer.cpp') diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index 1b2f6514268b..1700473b655c 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -729,7 +729,7 @@ void FontRenderer::blurImage(uint8_t** image, int32_t width, int32_t height, int if (width * height * radius >= RS_MIN_INPUT_CUTOFF) { uint8_t* outImage = (uint8_t*) memalign(RS_CPU_ALLOCATION_ALIGNMENT, width * height); - if (mRs.get() == 0) { + if (mRs == 0) { mRs = new RSC::RS(); if (!mRs->init(true, true)) { ALOGE("blur RS failed to init"); @@ -739,11 +739,13 @@ void FontRenderer::blurImage(uint8_t** image, int32_t width, int32_t height, int mRsScript = new RSC::ScriptIntrinsicBlur(mRs, mRsElement); } - sp t = RSC::Type::create(mRs, mRsElement, width, height, 0); - sp ain = RSC::Allocation::createTyped(mRs, t, RS_ALLOCATION_MIPMAP_NONE, - RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_SHARED, *image); - sp aout = RSC::Allocation::createTyped(mRs, t, RS_ALLOCATION_MIPMAP_NONE, - RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_SHARED, outImage); + RSC::sp t = RSC::Type::create(mRs, mRsElement, width, height, 0); + RSC::sp ain = RSC::Allocation::createTyped(mRs, t, + RS_ALLOCATION_MIPMAP_NONE, RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_SHARED, + *image); + RSC::sp aout = RSC::Allocation::createTyped(mRs, t, + RS_ALLOCATION_MIPMAP_NONE, RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_SHARED, + outImage); mRsScript->setRadius(radius); mRsScript->blur(ain, aout); -- cgit v1.2.3-59-g8ed1b