summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/androidfw/AssetManager.cpp14
-rw-r--r--libs/androidfw/ResourceTypes.cpp4
-rw-r--r--libs/androidfw/ZipFileRO.cpp8
-rw-r--r--libs/androidfw/tests/BackupData_test.cpp2
-rw-r--r--libs/hwui/AnimatorManager.cpp4
-rw-r--r--libs/hwui/Extensions.cpp1
-rw-r--r--libs/hwui/Extensions.h3
-rw-r--r--libs/hwui/FontRenderer.cpp2
8 files changed, 17 insertions, 21 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index 2dc1c96259c0..623ea896626b 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -34,7 +34,7 @@
#include <utils/String8.h>
#include <utils/threads.h>
#include <utils/Timers.h>
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
#include <cutils/trace.h>
#endif
@@ -54,7 +54,7 @@
_rc; })
#endif
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
#define MY_TRACE_BEGIN(x) ATRACE_BEGIN(x)
#define MY_TRACE_END() ATRACE_END()
#else
@@ -229,7 +229,7 @@ bool AssetManager::addAssetPath(const String8& path, int32_t* cookie)
*cookie = static_cast<int32_t>(mAssetPaths.size());
}
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
// Load overlays, if any
asset_path oap;
for (size_t idx = 0; mZipSet.getOverlay(ap.path, idx, &oap); idx++) {
@@ -657,7 +657,7 @@ bool AssetManager::appendPathToResTable(const asset_path& ap) const {
ALOGV("Creating shared resources for %s", ap.path.string());
sharedRes = new ResTable();
sharedRes->add(ass, idmap, nextEntryIdx + 1, false);
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
const char* data = getenv("ANDROID_DATA");
LOG_ALWAYS_FATAL_IF(data == NULL, "ANDROID_DATA not set");
String8 overlaysListPath(data);
@@ -1545,7 +1545,7 @@ bool AssetManager::scanAndMergeZipLocked(SortedVector<AssetDir::FileInfo>* pMerg
*/
int dirNameLen = dirName.length();
void *iterationCookie;
- if (!pZip->startIteration(&iterationCookie)) {
+ if (!pZip->startIteration(&iterationCookie, dirName.string(), NULL)) {
ALOGW("ZipFileRO::startIteration returned false");
return false;
}
@@ -1560,9 +1560,7 @@ bool AssetManager::scanAndMergeZipLocked(SortedVector<AssetDir::FileInfo>* pMerg
continue;
}
//printf("Comparing %s in %s?\n", nameBuf, dirName.string());
- if (dirNameLen == 0 ||
- (strncmp(nameBuf, dirName.string(), dirNameLen) == 0 &&
- nameBuf[dirNameLen] == '/'))
+ if (dirNameLen == 0 || nameBuf[dirNameLen] == '/')
{
const char* cp;
const char* nextSlash;
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 62aabb13858d..806eeda3555a 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -47,7 +47,7 @@
namespace android {
-#ifdef HAVE_WINSOCK
+#if defined(_WIN32)
#undef nhtol
#undef htonl
#define ntohl(x) ( ((x) << 24) | (((x) >> 24) & 255) | (((x) << 8) & 0xff0000) | (((x) >> 8) & 0xff00) )
@@ -727,7 +727,7 @@ const char16_t* ResStringPool::stringAt(size_t idx, size_t* u16len) const
AutoMutex lock(mDecodeLock);
if (mCache == NULL) {
-#ifndef HAVE_ANDROID_OS
+#ifndef __ANDROID__
if (kDebugStringPoolNoisy) {
ALOGI("CREATING STRING CACHE OF %zu bytes",
mHeader->stringCount*sizeof(char16_t**));
diff --git a/libs/androidfw/ZipFileRO.cpp b/libs/androidfw/ZipFileRO.cpp
index a6f6d8c4ff16..49fe8a261178 100644
--- a/libs/androidfw/ZipFileRO.cpp
+++ b/libs/androidfw/ZipFileRO.cpp
@@ -39,7 +39,7 @@ using namespace android;
class _ZipEntryRO {
public:
ZipEntry entry;
- ZipEntryName name;
+ ZipString name;
void *cookie;
_ZipEntryRO() : cookie(NULL) {}
@@ -80,7 +80,7 @@ ZipEntryRO ZipFileRO::findEntryByName(const char* entryName) const
{
_ZipEntryRO* data = new _ZipEntryRO;
- data->name = ZipEntryName(entryName);
+ data->name = ZipString(entryName);
const int32_t error = FindEntry(mHandle, data->name, &(data->entry));
if (error) {
@@ -133,8 +133,8 @@ bool ZipFileRO::startIteration(void** cookie) {
bool ZipFileRO::startIteration(void** cookie, const char* prefix, const char* suffix)
{
_ZipEntryRO* ze = new _ZipEntryRO;
- ZipEntryName pe(prefix ? prefix : "");
- ZipEntryName se(suffix ? suffix : "");
+ ZipString pe(prefix ? prefix : "");
+ ZipString se(suffix ? suffix : "");
int32_t error = StartIteration(mHandle, &(ze->cookie),
prefix ? &pe : NULL,
suffix ? &se : NULL);
diff --git a/libs/androidfw/tests/BackupData_test.cpp b/libs/androidfw/tests/BackupData_test.cpp
index 92af7fe790bd..e25b616dcbd9 100644
--- a/libs/androidfw/tests/BackupData_test.cpp
+++ b/libs/androidfw/tests/BackupData_test.cpp
@@ -108,7 +108,7 @@ TEST_F(BackupDataTest, WriteAndReadSingle) {
EXPECT_EQ(DATA1[i], dataBytes[i])
<< "data character " << i << " should be equal";
}
- delete dataBytes;
+ delete[] dataBytes;
delete writer;
delete reader;
}
diff --git a/libs/hwui/AnimatorManager.cpp b/libs/hwui/AnimatorManager.cpp
index 0dababd774c1..cd30b1859384 100644
--- a/libs/hwui/AnimatorManager.cpp
+++ b/libs/hwui/AnimatorManager.cpp
@@ -124,8 +124,6 @@ uint32_t AnimatorManager::animate(TreeInfo& info) {
}
void AnimatorManager::animateNoDamage(TreeInfo& info) {
- if (!mAnimators.size()) return;
-
animateCommon(info);
}
@@ -169,7 +167,7 @@ private:
};
void AnimatorManager::endAllActiveAnimators() {
- ALOGD("endAllStagingAnimators on %p (%s) with handle %p",
+ ALOGD("endAllActiveAnimators on %p (%s) with handle %p",
&mParent, mParent.getName(), mAnimationHandle);
EndActiveAnimatorsFunctor functor(mAnimationHandle->context());
for_each(mAnimators.begin(), mAnimators.end(), functor);
diff --git a/libs/hwui/Extensions.cpp b/libs/hwui/Extensions.cpp
index 2a82216eb145..d96775aa7ff1 100644
--- a/libs/hwui/Extensions.cpp
+++ b/libs/hwui/Extensions.cpp
@@ -58,6 +58,7 @@ Extensions::Extensions() {
mHasTiledRendering = hasGlExtension("GL_QCOM_tiled_rendering");
mHas1BitStencil = hasGlExtension("GL_OES_stencil1");
mHas4BitStencil = hasGlExtension("GL_OES_stencil4");
+ mHasUnpackSubImage = hasGlExtension("GL_EXT_unpack_subimage");
// Query EGL extensions
findExtensions(eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS), mEglExtensionList);
diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h
index e7d317d21941..a4eef0f0bb86 100644
--- a/libs/hwui/Extensions.h
+++ b/libs/hwui/Extensions.h
@@ -44,7 +44,7 @@ public:
inline bool has1BitStencil() const { return mHas1BitStencil; }
inline bool has4BitStencil() const { return mHas4BitStencil; }
inline bool hasNvSystemTime() const { return mHasNvSystemTime; }
- inline bool hasUnpackRowLength() const { return mVersionMajor >= 3; }
+ inline bool hasUnpackRowLength() const { return mVersionMajor >= 3 || mHasUnpackSubImage; }
inline bool hasPixelBufferObjects() const { return mVersionMajor >= 3; }
inline bool hasOcclusionQueries() const { return mVersionMajor >= 3; }
inline bool hasFloatTextures() const { return mVersionMajor >= 3; }
@@ -71,6 +71,7 @@ private:
bool mHas1BitStencil;
bool mHas4BitStencil;
bool mHasNvSystemTime;
+ bool mHasUnpackSubImage;
int mVersionMajor;
int mVersionMinor;
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 35051b7cccea..9c2c1192a69d 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -474,7 +474,6 @@ void FontRenderer::issueDrawCommand(Vector<CacheTexture*>& cacheTextures) {
if (!mFunctor) return;
bool first = true;
- bool forceRebind = false;
for (uint32_t i = 0; i < cacheTextures.size(); i++) {
CacheTexture* texture = cacheTextures[i];
if (texture->canDraw()) {
@@ -487,7 +486,6 @@ void FontRenderer::issueDrawCommand(Vector<CacheTexture*>& cacheTextures) {
mFunctor->draw(*texture, mLinearFiltering);
texture->resetMesh();
- forceRebind = false;
}
}
}