summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2011-03-16 21:22:10 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-16 21:22:10 -0700
commitb4a5f95b8e44d8029827722225ef7f93023ab1b3 (patch)
tree00f6523457ace6b6527e62ef61eb23abadb23c43 /graphics
parent05c4d6def58a1c20f4160147dc7b47227b5c8c68 (diff)
parent6ff211e08a7c5d51e3899d10be53878c05c244b5 (diff)
downloadframeworks_base-b4a5f95b8e44d8029827722225ef7f93023ab1b3.zip
frameworks_base-b4a5f95b8e44d8029827722225ef7f93023ab1b3.tar.gz
frameworks_base-b4a5f95b8e44d8029827722225ef7f93023ab1b3.tar.bz2
am 6ff211e0: am 8f6c5226: am 55a9be3d: Merge "Fix for bug 3434228" into honeycomb-mr1
* commit '6ff211e08a7c5d51e3899d10be53878c05c244b5': Fix for bug 3434228
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/renderscript/RenderScript.java6
-rw-r--r--graphics/java/android/renderscript/RenderScriptGL.java3
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp7
3 files changed, 9 insertions, 7 deletions
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 1b10c5c..b51279a 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -83,17 +83,17 @@ public class RenderScript {
int alphaMin, int alphaPref,
int depthMin, int depthPref,
int stencilMin, int stencilPref,
- int samplesMin, int samplesPref, float samplesQ);
+ int samplesMin, int samplesPref, float samplesQ, int dpi);
synchronized int nContextCreateGL(int dev, int ver,
int colorMin, int colorPref,
int alphaMin, int alphaPref,
int depthMin, int depthPref,
int stencilMin, int stencilPref,
- int samplesMin, int samplesPref, float samplesQ) {
+ int samplesMin, int samplesPref, float samplesQ, int dpi) {
return rsnContextCreateGL(dev, ver, colorMin, colorPref,
alphaMin, alphaPref, depthMin, depthPref,
stencilMin, stencilPref,
- samplesMin, samplesPref, samplesQ);
+ samplesMin, samplesPref, samplesQ, dpi);
}
native int rsnContextCreate(int dev, int ver);
synchronized int nContextCreate(int dev, int ver) {
diff --git a/graphics/java/android/renderscript/RenderScriptGL.java b/graphics/java/android/renderscript/RenderScriptGL.java
index 4359795..d4b5434 100644
--- a/graphics/java/android/renderscript/RenderScriptGL.java
+++ b/graphics/java/android/renderscript/RenderScriptGL.java
@@ -165,13 +165,14 @@ public class RenderScriptGL extends RenderScript {
mWidth = 0;
mHeight = 0;
mDev = nDeviceCreate();
+ int dpi = ctx.getResources().getDisplayMetrics().densityDpi;
mContext = nContextCreateGL(mDev, 0,
mSurfaceConfig.mColorMin, mSurfaceConfig.mColorPref,
mSurfaceConfig.mAlphaMin, mSurfaceConfig.mAlphaPref,
mSurfaceConfig.mDepthMin, mSurfaceConfig.mDepthPref,
mSurfaceConfig.mStencilMin, mSurfaceConfig.mStencilPref,
mSurfaceConfig.mSamplesMin, mSurfaceConfig.mSamplesPref,
- mSurfaceConfig.mSamplesQ);
+ mSurfaceConfig.mSamplesQ, dpi);
if (mContext == 0) {
throw new RSDriverException("Failed to create RS context.");
}
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index f86343a..2afd74c 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -164,7 +164,8 @@ nContextCreateGL(JNIEnv *_env, jobject _this, jint dev, jint ver,
int alphaMin, int alphaPref,
int depthMin, int depthPref,
int stencilMin, int stencilPref,
- int samplesMin, int samplesPref, float samplesQ)
+ int samplesMin, int samplesPref, float samplesQ,
+ int dpi)
{
RsSurfaceConfig sc;
sc.alphaMin = alphaMin;
@@ -178,7 +179,7 @@ nContextCreateGL(JNIEnv *_env, jobject _this, jint dev, jint ver,
sc.samplesQ = samplesQ;
LOG_API("nContextCreateGL");
- return (jint)rsContextCreateGL((RsDevice)dev, ver, sc);
+ return (jint)rsContextCreateGL((RsDevice)dev, ver, sc, dpi);
}
static void
@@ -1213,7 +1214,7 @@ static JNINativeMethod methods[] = {
// All methods below are thread protected in java.
{"rsnContextCreate", "(II)I", (void*)nContextCreate },
-{"rsnContextCreateGL", "(IIIIIIIIIIIIF)I", (void*)nContextCreateGL },
+{"rsnContextCreateGL", "(IIIIIIIIIIIIFI)I", (void*)nContextCreateGL },
{"rsnContextFinish", "(I)V", (void*)nContextFinish },
{"rsnContextSetPriority", "(II)V", (void*)nContextSetPriority },
{"rsnContextSetSurface", "(IIILandroid/view/Surface;)V", (void*)nContextSetSurface },