summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/androidfw/ResourceTypes.cpp2
-rw-r--r--libs/hwui/ShadowTessellator.cpp4
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp7
3 files changed, 9 insertions, 4 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 6aad5fb..7d4da01 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -102,7 +102,7 @@ static status_t validate_chunk(const ResChunk_header* chunk,
if (headerSize >= minSize) {
if (headerSize <= size) {
if (((headerSize|size)&0x3) == 0) {
- if ((ssize_t)size <= (dataEnd-((const uint8_t*)chunk))) {
+ if ((size_t)size <= (size_t)(dataEnd-((const uint8_t*)chunk))) {
return NO_ERROR;
}
ALOGW("%s data size 0x%x extends beyond resource end %p.",
diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp
index be49aed..55b82e4 100644
--- a/libs/hwui/ShadowTessellator.cpp
+++ b/libs/hwui/ShadowTessellator.cpp
@@ -196,6 +196,10 @@ Vector2 ShadowTessellator::centroid2d(const Vector2* poly, int polyLength) {
* @param len the number of points of the polygon
*/
bool ShadowTessellator::isClockwise(const Vector2* polygon, int len) {
+ if (len < 2 || polygon == NULL) {
+ ALOGW("Invalid polygon %p, length is %d @ isClockwise()", polygon, len);
+ return true;
+ }
double sum = 0;
double p1x = polygon[len - 1].x;
double p1y = polygon[len - 1].y;
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 5754536..48cd8fc 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -31,11 +31,10 @@
#define PROPERTY_RENDER_DIRTY_REGIONS "debug.hwui.render_dirty_regions"
#define GLES_VERSION 2
+#define USE_TEXTURE_ATLAS false
-#ifdef USE_OPENGL_RENDERER
// Android-specific addition that is used to show when frames began in systrace
EGLAPI void EGLAPIENTRY eglBeginFrame(EGLDisplay dpy, EGLSurface surface);
-#endif
namespace android {
namespace uirenderer {
@@ -230,7 +229,9 @@ void GlobalContext::setTextureAtlas(const sp<GraphicBuffer>& buffer,
}
void GlobalContext::initAtlas() {
- Caches::getInstance().assetAtlas.init(mAtlasBuffer, mAtlasMap, mAtlasMapSize);
+ if (USE_TEXTURE_ATLAS) {
+ Caches::getInstance().assetAtlas.init(mAtlasBuffer, mAtlasMap, mAtlasMapSize);
+ }
}
void GlobalContext::usePBufferSurface() {