summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/androidfw/Asset.cpp12
-rw-r--r--libs/androidfw/AssetManager.cpp10
-rw-r--r--libs/androidfw/ZipFileRO.cpp7
-rw-r--r--libs/hwui/RenderNode.cpp8
4 files changed, 17 insertions, 20 deletions
diff --git a/libs/androidfw/Asset.cpp b/libs/androidfw/Asset.cpp
index 782806e..4e14b13 100644
--- a/libs/androidfw/Asset.cpp
+++ b/libs/androidfw/Asset.cpp
@@ -296,13 +296,13 @@ Asset::~Asset(void)
* Create a new Asset from compressed data in a memory mapping.
*/
/*static*/ Asset* Asset::createFromCompressedMap(FileMap* dataMap,
- int method, size_t uncompressedLen, AccessMode mode)
+ size_t uncompressedLen, AccessMode mode)
{
_CompressedAsset* pAsset;
status_t result;
pAsset = new _CompressedAsset;
- result = pAsset->openChunk(dataMap, method, uncompressedLen);
+ result = pAsset->openChunk(dataMap, uncompressedLen);
if (result != NO_ERROR)
return NULL;
@@ -734,18 +734,12 @@ status_t _CompressedAsset::openChunk(int fd, off64_t offset,
*
* Nothing is expanded until the first read call.
*/
-status_t _CompressedAsset::openChunk(FileMap* dataMap, int compressionMethod,
- size_t uncompressedLen)
+status_t _CompressedAsset::openChunk(FileMap* dataMap, size_t uncompressedLen)
{
assert(mFd < 0); // no re-open
assert(mMap == NULL);
assert(dataMap != NULL);
- if (compressionMethod != ZipFileRO::kCompressDeflated) {
- assert(false);
- return UNKNOWN_ERROR;
- }
-
mMap = dataMap;
mStart = -1; // not used
mCompressedLen = dataMap->getDataLength();
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index 25cd363..2dc1c96 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -1156,13 +1156,11 @@ Asset* AssetManager::openAssetFromZipLocked(const ZipFileRO* pZipFile,
Asset* pAsset = NULL;
// TODO: look for previously-created shared memory slice?
- int method;
- size_t uncompressedLen;
+ uint16_t method;
+ uint32_t uncompressedLen;
//printf("USING Zip '%s'\n", pEntry->getFileName());
- //pZipFile->getEntryInfo(entry, &method, &uncompressedLen, &compressedLen,
- // &offset);
if (!pZipFile->getEntryInfo(entry, &method, &uncompressedLen, NULL, NULL,
NULL, NULL))
{
@@ -1181,8 +1179,8 @@ Asset* AssetManager::openAssetFromZipLocked(const ZipFileRO* pZipFile,
ALOGV("Opened uncompressed entry %s in zip %s mode %d: %p", entryName.string(),
dataMap->getFileName(), mode, pAsset);
} else {
- pAsset = Asset::createFromCompressedMap(dataMap, method,
- uncompressedLen, mode);
+ pAsset = Asset::createFromCompressedMap(dataMap,
+ static_cast<size_t>(uncompressedLen), mode);
ALOGV("Opened compressed entry %s in zip %s mode %d: %p", entryName.string(),
dataMap->getFileName(), mode, pAsset);
}
diff --git a/libs/androidfw/ZipFileRO.cpp b/libs/androidfw/ZipFileRO.cpp
index 93b1d56..6f927b4 100644
--- a/libs/androidfw/ZipFileRO.cpp
+++ b/libs/androidfw/ZipFileRO.cpp
@@ -97,8 +97,9 @@ ZipEntryRO ZipFileRO::findEntryByName(const char* entryName) const
* Returns "false" if the offsets to the fields or the contents of the fields
* appear to be bogus.
*/
-bool ZipFileRO::getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen,
- size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32) const
+bool ZipFileRO::getEntryInfo(ZipEntryRO entry, uint16_t* pMethod,
+ uint32_t* pUncompLen, uint32_t* pCompLen, off64_t* pOffset,
+ uint32_t* pModWhen, uint32_t* pCrc32) const
{
const _ZipEntryRO* zipEntry = reinterpret_cast<_ZipEntryRO*>(entry);
const ZipEntry& ze = zipEntry->entry;
@@ -166,7 +167,7 @@ void ZipFileRO::releaseEntry(ZipEntryRO entry) const
/*
* Copy the entry's filename to the buffer.
*/
-int ZipFileRO::getEntryFileName(ZipEntryRO entry, char* buffer, int bufLen)
+int ZipFileRO::getEntryFileName(ZipEntryRO entry, char* buffer, size_t bufLen)
const
{
const _ZipEntryRO* zipEntry = reinterpret_cast<_ZipEntryRO*>(entry);
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index b4cbc36..fc18491 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -241,8 +241,12 @@ void RenderNode::prepareTreeImpl(TreeInfo& info, bool functorsNeedLayer) {
animatorDirtyMask = mAnimatorManager.animate(info);
}
- bool willHaveFunctor = info.mode == TreeInfo::MODE_FULL && mStagingDisplayListData
- ? !mStagingDisplayListData->functors.isEmpty() : !mDisplayListData->functors.isEmpty();
+ bool willHaveFunctor = false;
+ if (info.mode == TreeInfo::MODE_FULL && mStagingDisplayListData) {
+ willHaveFunctor = !mStagingDisplayListData->functors.isEmpty();
+ } else if (mDisplayListData) {
+ willHaveFunctor = !mDisplayListData->functors.isEmpty();
+ }
bool childFunctorsNeedLayer = mProperties.prepareForFunctorPresence(
willHaveFunctor, functorsNeedLayer);