Loading graphics/java/android/renderscript/RenderScript.java +3 −3 Original line number Diff line number Diff line Loading @@ -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) { Loading graphics/java/android/renderscript/RenderScriptGL.java +2 −1 Original line number Diff line number Diff line Loading @@ -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."); } Loading graphics/jni/android_renderscript_RenderScript.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 Loading Loading @@ -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 }, Loading libs/rs/RenderScript.h +2 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,8 @@ void rsDeviceDestroy(RsDevice); void rsDeviceSetConfig(RsDevice, RsDeviceParam, int32_t value); RsContext rsContextCreate(RsDevice, uint32_t version); RsContext rsContextCreateGL(RsDevice, uint32_t version, RsSurfaceConfig sc); RsContext rsContextCreateGL(RsDevice, uint32_t version, RsSurfaceConfig sc, uint32_t dpi); void rsContextDestroy(RsContext); enum RsMessageToClientType { Loading libs/rs/rsContext.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -630,6 +630,7 @@ Context::Context() { mPaused = false; mObjHead = NULL; mError = RS_ERROR_NONE; mDPI = 96; } Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc) { Loading Loading @@ -1078,10 +1079,12 @@ RsContext rsContextCreate(RsDevice vdev, uint32_t version) { return rsc; } RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, RsSurfaceConfig sc) { RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, RsSurfaceConfig sc, uint32_t dpi) { LOGV("rsContextCreateGL %p", vdev); Device * dev = static_cast<Device *>(vdev); Context *rsc = Context::createContext(dev, &sc); rsc->setDPI(dpi); LOGV("rsContextCreateGL ret %p ", rsc); return rsc; } Loading Loading
graphics/java/android/renderscript/RenderScript.java +3 −3 Original line number Diff line number Diff line Loading @@ -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) { Loading
graphics/java/android/renderscript/RenderScriptGL.java +2 −1 Original line number Diff line number Diff line Loading @@ -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."); } Loading
graphics/jni/android_renderscript_RenderScript.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 Loading Loading @@ -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 }, Loading
libs/rs/RenderScript.h +2 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,8 @@ void rsDeviceDestroy(RsDevice); void rsDeviceSetConfig(RsDevice, RsDeviceParam, int32_t value); RsContext rsContextCreate(RsDevice, uint32_t version); RsContext rsContextCreateGL(RsDevice, uint32_t version, RsSurfaceConfig sc); RsContext rsContextCreateGL(RsDevice, uint32_t version, RsSurfaceConfig sc, uint32_t dpi); void rsContextDestroy(RsContext); enum RsMessageToClientType { Loading
libs/rs/rsContext.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -630,6 +630,7 @@ Context::Context() { mPaused = false; mObjHead = NULL; mError = RS_ERROR_NONE; mDPI = 96; } Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc) { Loading Loading @@ -1078,10 +1079,12 @@ RsContext rsContextCreate(RsDevice vdev, uint32_t version) { return rsc; } RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, RsSurfaceConfig sc) { RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, RsSurfaceConfig sc, uint32_t dpi) { LOGV("rsContextCreateGL %p", vdev); Device * dev = static_cast<Device *>(vdev); Context *rsc = Context::createContext(dev, &sc); rsc->setDPI(dpi); LOGV("rsContextCreateGL ret %p ", rsc); return rsc; } Loading