Loading core/java/android/widget/TextView.java +18 −16 Original line number Diff line number Diff line Loading @@ -3964,8 +3964,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mHighlightPath = new Path(); if (selStart == selEnd) { if ((SystemClock.uptimeMillis() - mShowCursor) % (2 * BLINK) < BLINK) { if ((SystemClock.uptimeMillis() - mShowCursor) % (2 * BLINK) < BLINK) { if (mHighlightPathBogus) { mHighlightPath.reset(); mLayout.getCursorPath(selStart, mHighlightPath, mText); Loading Loading @@ -5344,8 +5343,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * will happen at measure). */ makeNewLayout(want, hintWant, UNKNOWN_BORING, UNKNOWN_BORING, mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(), false); mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(), false); if (mEllipsize != TextUtils.TruncateAt.MARQUEE) { // In a fixed-height view, so use our new text layout. if (mLayoutParams.height != LayoutParams.WRAP_CONTENT && mLayoutParams.height != LayoutParams.FILL_PARENT) { Loading @@ -5360,6 +5361,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener invalidate(); return; } } // We lose: the height has changed and we have a dynamic height. // Request a new view layout using our new text layout. Loading graphics/java/android/renderscript/RSSurfaceView.java +6 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback */ public void surfaceDestroyed(SurfaceHolder holder) { // Surface will be destroyed when we return if (mRS != null) { mRS.contextSetSurface(null); } //Log.v(RenderScript.LOG_TAG, "surfaceDestroyed"); } Loading @@ -88,6 +91,9 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback * not normally called or subclassed by clients of RSSurfaceView. */ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { if (mRS != null) { mRS.contextSetSurface(holder.getSurface()); } //Log.v(RenderScript.LOG_TAG, "surfaceChanged"); } Loading graphics/java/android/renderscript/RenderScript.java +6 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class RenderScript { native void nDeviceSetConfig(int dev, int param, int value); native int nContextCreate(int dev, Surface sur, int ver, boolean useDepth); native void nContextDestroy(int con); native void nContextSetSurface(Surface sur); native void nContextBindRootScript(int script); native void nContextBindSampler(int sampler, int slot); Loading Loading @@ -276,6 +277,11 @@ public class RenderScript { mMessageThread.start(); } public void contextSetSurface(Surface sur) { mSurface = sur; nContextSetSurface(mSurface); } public void destroy() { nContextDeinitToClient(); mMessageThread.mRun = false; Loading graphics/jni/android_renderscript_RenderScript.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,24 @@ nContextCreate(JNIEnv *_env, jobject _this, jint dev, jobject wnd, jint ver, jbo return (jint)rsContextCreate((RsDevice)dev, window, ver, useDepth); } static void nContextSetSurface(JNIEnv *_env, jobject _this, jobject wnd) { RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); LOG_API("nContextSetSurface, con(%p), surface(%p)", con, (Surface *)wnd); Surface * window = NULL; if (wnd == NULL) { } else { jclass surface_class = _env->FindClass("android/view/Surface"); jfieldID surfaceFieldID = _env->GetFieldID(surface_class, "mSurface", "I"); window = (Surface*)_env->GetIntField(wnd, surfaceFieldID); } rsContextSetSurface(con, window); } static void nContextDestroy(JNIEnv *_env, jobject _this, jint con) { Loading Loading @@ -1328,6 +1346,7 @@ static JNINativeMethod methods[] = { {"nDeviceDestroy", "(I)V", (void*)nDeviceDestroy }, {"nDeviceSetConfig", "(III)V", (void*)nDeviceSetConfig }, {"nContextCreate", "(ILandroid/view/Surface;IZ)I", (void*)nContextCreate }, {"nContextSetSurface", "(Landroid/view/Surface;)V", (void*)nContextSetSurface }, {"nContextDestroy", "(I)V", (void*)nContextDestroy }, {"nContextPause", "()V", (void*)nContextPause }, {"nContextResume", "()V", (void*)nContextResume }, Loading libs/rs/rs.spec +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ ContextPause { ContextResume { } ContextSetSurface { param void *sur } AssignName { param void *obj param const char *name Loading Loading
core/java/android/widget/TextView.java +18 −16 Original line number Diff line number Diff line Loading @@ -3964,8 +3964,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mHighlightPath = new Path(); if (selStart == selEnd) { if ((SystemClock.uptimeMillis() - mShowCursor) % (2 * BLINK) < BLINK) { if ((SystemClock.uptimeMillis() - mShowCursor) % (2 * BLINK) < BLINK) { if (mHighlightPathBogus) { mHighlightPath.reset(); mLayout.getCursorPath(selStart, mHighlightPath, mText); Loading Loading @@ -5344,8 +5343,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * will happen at measure). */ makeNewLayout(want, hintWant, UNKNOWN_BORING, UNKNOWN_BORING, mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(), false); mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(), false); if (mEllipsize != TextUtils.TruncateAt.MARQUEE) { // In a fixed-height view, so use our new text layout. if (mLayoutParams.height != LayoutParams.WRAP_CONTENT && mLayoutParams.height != LayoutParams.FILL_PARENT) { Loading @@ -5360,6 +5361,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener invalidate(); return; } } // We lose: the height has changed and we have a dynamic height. // Request a new view layout using our new text layout. Loading
graphics/java/android/renderscript/RSSurfaceView.java +6 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback */ public void surfaceDestroyed(SurfaceHolder holder) { // Surface will be destroyed when we return if (mRS != null) { mRS.contextSetSurface(null); } //Log.v(RenderScript.LOG_TAG, "surfaceDestroyed"); } Loading @@ -88,6 +91,9 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback * not normally called or subclassed by clients of RSSurfaceView. */ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { if (mRS != null) { mRS.contextSetSurface(holder.getSurface()); } //Log.v(RenderScript.LOG_TAG, "surfaceChanged"); } Loading
graphics/java/android/renderscript/RenderScript.java +6 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class RenderScript { native void nDeviceSetConfig(int dev, int param, int value); native int nContextCreate(int dev, Surface sur, int ver, boolean useDepth); native void nContextDestroy(int con); native void nContextSetSurface(Surface sur); native void nContextBindRootScript(int script); native void nContextBindSampler(int sampler, int slot); Loading Loading @@ -276,6 +277,11 @@ public class RenderScript { mMessageThread.start(); } public void contextSetSurface(Surface sur) { mSurface = sur; nContextSetSurface(mSurface); } public void destroy() { nContextDeinitToClient(); mMessageThread.mRun = false; Loading
graphics/jni/android_renderscript_RenderScript.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,24 @@ nContextCreate(JNIEnv *_env, jobject _this, jint dev, jobject wnd, jint ver, jbo return (jint)rsContextCreate((RsDevice)dev, window, ver, useDepth); } static void nContextSetSurface(JNIEnv *_env, jobject _this, jobject wnd) { RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); LOG_API("nContextSetSurface, con(%p), surface(%p)", con, (Surface *)wnd); Surface * window = NULL; if (wnd == NULL) { } else { jclass surface_class = _env->FindClass("android/view/Surface"); jfieldID surfaceFieldID = _env->GetFieldID(surface_class, "mSurface", "I"); window = (Surface*)_env->GetIntField(wnd, surfaceFieldID); } rsContextSetSurface(con, window); } static void nContextDestroy(JNIEnv *_env, jobject _this, jint con) { Loading Loading @@ -1328,6 +1346,7 @@ static JNINativeMethod methods[] = { {"nDeviceDestroy", "(I)V", (void*)nDeviceDestroy }, {"nDeviceSetConfig", "(III)V", (void*)nDeviceSetConfig }, {"nContextCreate", "(ILandroid/view/Surface;IZ)I", (void*)nContextCreate }, {"nContextSetSurface", "(Landroid/view/Surface;)V", (void*)nContextSetSurface }, {"nContextDestroy", "(I)V", (void*)nContextDestroy }, {"nContextPause", "()V", (void*)nContextPause }, {"nContextResume", "()V", (void*)nContextResume }, Loading
libs/rs/rs.spec +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ ContextPause { ContextResume { } ContextSetSurface { param void *sur } AssignName { param void *obj param const char *name Loading