summaryrefslogtreecommitdiffstats
path: root/core/jni/android
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-11-20 15:41:25 -0800
committerDan Albert <danalbert@google.com>2014-11-20 15:41:25 -0800
commit3a091b79978caa9b5d58ae19f693279e5a717c2a (patch)
tree4c2624225f565fd66f80c3475311a0262059caca /core/jni/android
parenta8f7a40b4b98f19b5ee99a8dfb4177d430707623 (diff)
parent8e0cfe7c9e3a5bb5d9a8444fd357a44e72fd01f1 (diff)
downloadframeworks_base-3a091b79978caa9b5d58ae19f693279e5a717c2a.zip
frameworks_base-3a091b79978caa9b5d58ae19f693279e5a717c2a.tar.gz
frameworks_base-3a091b79978caa9b5d58ae19f693279e5a717c2a.tar.bz2
resolved conflicts for merge of 8e0cfe7c to lmp-mr1-dev-plus-aosp
Change-Id: I068d2a0fb118d4e2b4c1e546bebfcbc2cb120d36
Diffstat (limited to 'core/jni/android')
-rwxr-xr-xcore/jni/android/graphics/Bitmap.cpp5
-rw-r--r--core/jni/android/graphics/BitmapFactory.cpp10
-rw-r--r--core/jni/android/graphics/GraphicsJNI.h3
-rw-r--r--core/jni/android/graphics/NinePatchImpl.cpp2
-rw-r--r--core/jni/android/graphics/pdf/PdfEditor.cpp12
-rw-r--r--core/jni/android/graphics/pdf/PdfRenderer.cpp8
-rw-r--r--core/jni/android/opengl/util.cpp12
7 files changed, 24 insertions, 28 deletions
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index d7eef6e..61a34e5 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -43,8 +43,11 @@ static void FromColor_D32(void* dst, const SkColor src[], int width,
static void FromColor_D32_Raw(void* dst, const SkColor src[], int width,
int, int) {
+ // Needed to thwart the unreachable code detection from clang.
+ static const bool sk_color_ne_zero = SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER;
+
// SkColor's ordering may be different from SkPMColor
- if (SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER) {
+ if (sk_color_ne_zero) {
memcpy(dst, src, width * sizeof(SkColor));
return;
}
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index a578b5d..0e08a8d 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -49,12 +49,6 @@ jmethodID gInsetStruct_constructorMethodID;
using namespace android;
-static inline int32_t validOrNeg1(bool isValid, int32_t value) {
-// return isValid ? value : -1;
- SkASSERT((int)isValid == 0 || (int)isValid == 1);
- return ((int32_t)isValid - 1) | value;
-}
-
jstring getMimeTypeString(JNIEnv* env, SkImageDecoder::Format format) {
static const struct {
SkImageDecoder::Format fFormat;
@@ -185,8 +179,8 @@ public:
const size_t size = sk_64_asS32(size64);
if (size > mSize) {
- ALOGW("bitmap marked for reuse (%d bytes) can't fit new bitmap (%d bytes)",
- mSize, size);
+ ALOGW("bitmap marked for reuse (%u bytes) can't fit new bitmap "
+ "(%zu bytes)", mSize, size);
return false;
}
diff --git a/core/jni/android/graphics/GraphicsJNI.h b/core/jni/android/graphics/GraphicsJNI.h
index e2b31cb..8ef56cf 100644
--- a/core/jni/android/graphics/GraphicsJNI.h
+++ b/core/jni/android/graphics/GraphicsJNI.h
@@ -19,7 +19,7 @@ class SkCanvas;
namespace android {
class Paint;
-class TypefaceImpl;
+struct TypefaceImpl;
}
class GraphicsJNI {
@@ -205,7 +205,6 @@ public:
private:
JavaVM* fVM;
- bool fAllocateInJavaHeap;
jbyteArray fStorageObj;
int fAllocCount;
};
diff --git a/core/jni/android/graphics/NinePatchImpl.cpp b/core/jni/android/graphics/NinePatchImpl.cpp
index c162c48..39a9554 100644
--- a/core/jni/android/graphics/NinePatchImpl.cpp
+++ b/core/jni/android/graphics/NinePatchImpl.cpp
@@ -120,7 +120,7 @@ void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds,
const int32_t* yDivs = chunk.getYDivs();
// if our SkCanvas were back by GL we should enable this and draw this as
// a mesh, which will be faster in most cases.
- if (false) {
+ if ((false)) {
SkNinePatch::DrawMesh(canvas, bounds, bitmap,
xDivs, chunk.numXDivs,
yDivs, chunk.numYDivs,
diff --git a/core/jni/android/graphics/pdf/PdfEditor.cpp b/core/jni/android/graphics/pdf/PdfEditor.cpp
index 98c42c9..17090b7 100644
--- a/core/jni/android/graphics/pdf/PdfEditor.cpp
+++ b/core/jni/android/graphics/pdf/PdfEditor.cpp
@@ -97,12 +97,12 @@ static jlong nativeOpen(JNIEnv* env, jclass thiz, jint fd, jlong size) {
switch (error) {
case FPDF_ERR_PASSWORD:
case FPDF_ERR_SECURITY: {
- jniThrowException(env, "java/lang/SecurityException",
- "cannot create document. Error:" + error);
+ jniThrowExceptionFmt(env, "java/lang/SecurityException",
+ "cannot create document. Error: %ld", error);
} break;
default: {
- jniThrowException(env, "java/io/IOException",
- "cannot create document. Error:" + error);
+ jniThrowExceptionFmt(env, "java/io/IOException",
+ "cannot create document. Error: %ld", error);
} break;
}
destroyLibraryIfNeeded();
@@ -169,8 +169,8 @@ static void nativeWrite(JNIEnv* env, jclass thiz, jlong documentPtr, jint fd) {
writer.WriteBlock = &writeBlock;
const bool success = FPDF_SaveAsCopy(document, &writer, FPDF_NO_INCREMENTAL);
if (!success) {
- jniThrowException(env, "java/io/IOException",
- "cannot write to fd. Error:" + errno);
+ jniThrowExceptionFmt(env, "java/io/IOException",
+ "cannot write to fd. Error: %d", errno);
destroyLibraryIfNeeded();
}
}
diff --git a/core/jni/android/graphics/pdf/PdfRenderer.cpp b/core/jni/android/graphics/pdf/PdfRenderer.cpp
index 2080f16..3319578 100644
--- a/core/jni/android/graphics/pdf/PdfRenderer.cpp
+++ b/core/jni/android/graphics/pdf/PdfRenderer.cpp
@@ -89,12 +89,12 @@ static jlong nativeCreate(JNIEnv* env, jclass thiz, jint fd, jlong size) {
switch (error) {
case FPDF_ERR_PASSWORD:
case FPDF_ERR_SECURITY: {
- jniThrowException(env, "java/lang/SecurityException",
- "cannot create document. Error:" + error);
+ jniThrowExceptionFmt(env, "java/lang/SecurityException",
+ "cannot create document. Error: %ld", error);
} break;
default: {
- jniThrowException(env, "java/io/IOException",
- "cannot create document. Error:" + error);
+ jniThrowExceptionFmt(env, "java/io/IOException",
+ "cannot create document. Error: %ld", error);
} break;
}
destroyLibraryIfNeeded();
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index e0ca951..f60a154 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -471,13 +471,13 @@ static
void multiplyMM(float* r, const float* lhs, const float* rhs)
{
for (int i=0 ; i<4 ; i++) {
- register const float rhs_i0 = rhs[ I(i,0) ];
- register float ri0 = lhs[ I(0,0) ] * rhs_i0;
- register float ri1 = lhs[ I(0,1) ] * rhs_i0;
- register float ri2 = lhs[ I(0,2) ] * rhs_i0;
- register float ri3 = lhs[ I(0,3) ] * rhs_i0;
+ const float rhs_i0 = rhs[ I(i,0) ];
+ float ri0 = lhs[ I(0,0) ] * rhs_i0;
+ float ri1 = lhs[ I(0,1) ] * rhs_i0;
+ float ri2 = lhs[ I(0,2) ] * rhs_i0;
+ float ri3 = lhs[ I(0,3) ] * rhs_i0;
for (int j=1 ; j<4 ; j++) {
- register const float rhs_ij = rhs[ I(i,j) ];
+ const float rhs_ij = rhs[ I(i,j) ];
ri0 += lhs[ I(j,0) ] * rhs_ij;
ri1 += lhs[ I(j,1) ] * rhs_ij;
ri2 += lhs[ I(j,2) ] * rhs_ij;