diff options
50 files changed, 765 insertions, 407 deletions
@@ -400,6 +400,8 @@ web_docs_sample_code_flags := \ resources/samples/CubeLiveWallpaper "Live Wallpaper" \ -samplecode $(sample_dir)/Home \ resources/samples/Home "Home" \ + -samplecode $(sample_dir)/Honeycomb-Gallery \ + resources/samples/Honeycomb-Gallery "Honeycomb Gallery" \ -samplecode $(sample_dir)/JetBoy \ resources/samples/JetBoy "JetBoy" \ -samplecode $(sample_dir)/LunarLander \ @@ -206385,25 +206385,6 @@ > </field> </class> -<class name="KeyCharacterMap.KeyCharacterMapUnavailableException" - extends="android.util.AndroidRuntimeException" - abstract="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<constructor name="KeyCharacterMap.KeyCharacterMapUnavailableException" - type="android.view.KeyCharacterMap.KeyCharacterMapUnavailableException" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="msg" type="java.lang.String"> -</parameter> -</constructor> -</class> <class name="KeyCharacterMap.KeyData" extends="java.lang.Object" abstract="false" @@ -206463,6 +206444,25 @@ > </field> </class> +<class name="KeyCharacterMap.UnavailableException" + extends="android.util.AndroidRuntimeException" + abstract="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<constructor name="KeyCharacterMap.UnavailableException" + type="android.view.KeyCharacterMap.UnavailableException" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="msg" type="java.lang.String"> +</parameter> +</constructor> +</class> <class name="KeyEvent" extends="android.view.InputEvent" abstract="false" diff --git a/api/current.xml b/api/current.xml index 83bfedb..75b1dc2 100644 --- a/api/current.xml +++ b/api/current.xml @@ -206396,25 +206396,6 @@ > </field> </class> -<class name="KeyCharacterMap.KeyCharacterMapUnavailableException" - extends="android.util.AndroidRuntimeException" - abstract="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<constructor name="KeyCharacterMap.KeyCharacterMapUnavailableException" - type="android.view.KeyCharacterMap.KeyCharacterMapUnavailableException" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="msg" type="java.lang.String"> -</parameter> -</constructor> -</class> <class name="KeyCharacterMap.KeyData" extends="java.lang.Object" abstract="false" @@ -206474,6 +206455,25 @@ > </field> </class> +<class name="KeyCharacterMap.UnavailableException" + extends="android.util.AndroidRuntimeException" + abstract="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<constructor name="KeyCharacterMap.UnavailableException" + type="android.view.KeyCharacterMap.UnavailableException" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="msg" type="java.lang.String"> +</parameter> +</constructor> +</class> <class name="KeyEvent" extends="android.view.InputEvent" abstract="false" diff --git a/core/java/android/view/KeyCharacterMap.java b/core/java/android/view/KeyCharacterMap.java index 7ca5a19..3ff7fcd 100644 --- a/core/java/android/view/KeyCharacterMap.java +++ b/core/java/android/view/KeyCharacterMap.java @@ -170,7 +170,7 @@ public class KeyCharacterMap { * * @param deviceId The device id of the keyboard. * @return The associated key character map. - * @throws {@link KeyCharacterMapUnavailableException} if the key character map + * @throws {@link UnavailableException} if the key character map * could not be loaded because it was malformed or the default key character map * is missing from the system. */ @@ -692,8 +692,8 @@ public class KeyCharacterMap { /** * Thrown by {@link KeyCharacterMap#load} when a key character map could not be loaded. */ - public static class KeyCharacterMapUnavailableException extends AndroidRuntimeException { - public KeyCharacterMapUnavailableException(String msg) { + public static class UnavailableException extends AndroidRuntimeException { + public UnavailableException(String msg) { super(msg); } } diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index ecf1aef..941331a 100755 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -2163,7 +2163,7 @@ public class KeyEvent extends InputEvent implements Parcelable { * Gets the {@link KeyCharacterMap} associated with the keyboard device. * * @return The associated key character map. - * @throws {@link KeyCharacterMapUnavailableException} if the key character map + * @throws {@link UnavailableException} if the key character map * could not be loaded because it was malformed or the default key character map * is missing from the system. * diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 7b3ea74..82e6964 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -499,6 +499,15 @@ public class WebView extends AbsoluteLayout // if true, multi-touch events will be passed to webkit directly before UI private boolean mDeferMultitouch = false; + // Currently, multi-touch events are sent to WebKit first then back to + // WebView while single-touch events are handled in WebView first. + // So there is a chance that a single-touch move event is handled in WebView + // before multi-touch events are finished. + // if mIsHandlingMultiTouch is true, which means multi-touch event handling + // is not finished, then any single-touch move event will be skipped. + // FIXME: send single-touch events to WebKit first then back to WebView. + private boolean mIsHandlingMultiTouch = false; + // to avoid interfering with the current touch events, track them // separately. Currently no snapping or fling in the deferred process mode private int mDeferTouchMode = TOUCH_DONE_MODE; @@ -5356,11 +5365,19 @@ public class WebView extends AbsoluteLayout if (DebugFlags.WEB_VIEW) { Log.v(LOGTAG, "passing " + ev.getPointerCount() + " points to webkit"); } + if (!mIsHandlingMultiTouch) { + mIsHandlingMultiTouch = true; + } passMultiTouchToWebKit(ev); return true; + } else { + // Skip ACTION_MOVE for single touch if it's still handling multi-touch. + if (mIsHandlingMultiTouch && ev.getActionMasked() == MotionEvent.ACTION_MOVE) { + return false; + } } - return handleTouchEventCommon(ev, Math.round(ev.getX()), Math.round(ev.getY())); + return handleTouchEventCommon(ev, ev.getActionMasked(), Math.round(ev.getX()), Math.round(ev.getY())); } /* @@ -5368,8 +5385,7 @@ public class WebView extends AbsoluteLayout * (x, y) denotes current focus point, which is the touch point for single touch * and the middle point for multi-touch. */ - private boolean handleTouchEventCommon(MotionEvent ev, int x, int y) { - int action = ev.getAction(); + private boolean handleTouchEventCommon(MotionEvent ev, int action, int x, int y) { long eventTime = ev.getEventTime(); @@ -5847,7 +5863,7 @@ public class WebView extends AbsoluteLayout private void passMultiTouchToWebKit(MotionEvent ev) { TouchEventData ted = new TouchEventData(); - ted.mAction = ev.getAction() & MotionEvent.ACTION_MASK; + ted.mAction = ev.getActionMasked(); final int count = ev.getPointerCount(); ted.mIds = new int[count]; ted.mPoints = new Point[count]; @@ -5866,7 +5882,7 @@ public class WebView extends AbsoluteLayout mPreventDefault = PREVENT_DEFAULT_IGNORE; } - private boolean handleMultiTouchInWebView(MotionEvent ev) { + private void handleMultiTouchInWebView(MotionEvent ev) { if (DebugFlags.WEB_VIEW) { Log.v(LOGTAG, "multi-touch: " + ev + " at " + ev.getEventTime() + " mTouchMode=" + mTouchMode @@ -5879,7 +5895,7 @@ public class WebView extends AbsoluteLayout // A few apps use WebView but don't instantiate gesture detector. // We don't need to support multi touch for them. - if (detector == null) return false; + if (detector == null) return; float x = ev.getX(); float y = ev.getY(); @@ -5914,7 +5930,7 @@ public class WebView extends AbsoluteLayout cancelLongPress(); mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS); if (!mZoomManager.supportsPanDuringZoom()) { - return false; + return; } mTouchMode = TOUCH_DRAG_MODE; if (mVelocityTracker == null) { @@ -5930,14 +5946,15 @@ public class WebView extends AbsoluteLayout // set mLastTouchX/Y to the remaining point mLastTouchX = Math.round(x); mLastTouchY = Math.round(y); + mIsHandlingMultiTouch = false; } else if (action == MotionEvent.ACTION_MOVE) { // negative x or y indicate it is on the edge, skip it. if (x < 0 || y < 0) { - return false; + return; } } - return handleTouchEventCommon(ev, Math.round(x), Math.round(y)); + handleTouchEventCommon(ev, action, Math.round(x), Math.round(y)); } private void cancelWebCoreTouchEvent(int x, int y, boolean removeEvents) { diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java index 0baddcb..e38a69f 100644 --- a/core/java/android/widget/Spinner.java +++ b/core/java/android/widget/Spinner.java @@ -23,13 +23,14 @@ import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.res.TypedArray; import android.database.DataSetObserver; -import android.graphics.drawable.Drawable; import android.graphics.Rect; +import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; +import android.view.ViewTreeObserver; /** @@ -69,6 +70,8 @@ public class Spinner extends AbsSpinner implements OnClickListener { private int mGravity; + private LayoutObserver mLayoutObserver; + /** * Construct a new spinner with the given context's theme. * @@ -169,6 +172,7 @@ public class Spinner extends AbsSpinner implements OnClickListener { com.android.internal.R.styleable.Spinner_dropDownHorizontalOffset, 0)); mPopup = popup; + mLayoutObserver = new LayoutObserver(); break; } } @@ -421,6 +425,11 @@ public class Spinner extends AbsSpinner implements OnClickListener { handled = true; if (!mPopup.isShowing()) { + if (mLayoutObserver != null) { + final ViewTreeObserver vto = getViewTreeObserver(); + vto.addOnGlobalLayoutListener(mLayoutObserver); + vto.addOnScrollChangedListener(mLayoutObserver); + } mPopup.show(); } } @@ -668,6 +677,7 @@ public class Spinner extends AbsSpinner implements OnClickListener { super.show(); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); setSelection(Spinner.this.getSelectedItemPosition()); + setOnDismissListener(mLayoutObserver); } @Override @@ -718,4 +728,28 @@ public class Spinner extends AbsSpinner implements OnClickListener { ViewGroup.LayoutParams.WRAP_CONTENT); } } + + private class LayoutObserver implements ViewTreeObserver.OnGlobalLayoutListener, + ViewTreeObserver.OnScrollChangedListener, PopupWindow.OnDismissListener { + @Override + public void onScrollChanged() { + if (mPopup != null && mPopup.isShowing()) { + mPopup.show(); + } + } + + @Override + public void onGlobalLayout() { + if (mPopup != null && mPopup.isShowing()) { + mPopup.show(); + } + } + + @Override + public void onDismiss() { + ViewTreeObserver vto = getViewTreeObserver(); + vto.removeGlobalOnLayoutListener(mLayoutObserver); + vto.removeOnScrollChangedListener(mLayoutObserver); + } + } } diff --git a/docs/html/resources/resources-data.js b/docs/html/resources/resources-data.js index 221406c..233838b 100644 --- a/docs/html/resources/resources-data.js +++ b/docs/html/resources/resources-data.js @@ -405,6 +405,16 @@ var ANDROID_RESOURCES = [ } }, { + tags: ['sample', 'new'], + path: 'samples/Honeycomb-Gallery/index.html', + title: { + en: 'Honeycomb Gallery' + }, + description: { + en: 'An image gallery application using Honeycomb-specific APIs.' + } + }, + { tags: ['sample', 'gamedev', 'media'], path: 'samples/JetBoy/index.html', title: { diff --git a/docs/html/resources/samples/images/hcgallery.png b/docs/html/resources/samples/images/hcgallery.png Binary files differnew file mode 100644 index 0000000..9a80fd7 --- /dev/null +++ b/docs/html/resources/samples/images/hcgallery.png diff --git a/libs/rs/java/tests/src/com/android/rs/test/fp_mad.rs b/libs/rs/java/tests/src/com/android/rs/test/fp_mad.rs index b02f85d..b6f2b2a 100644 --- a/libs/rs/java/tests/src/com/android/rs/test/fp_mad.rs +++ b/libs/rs/java/tests/src/com/android/rs/test/fp_mad.rs @@ -102,8 +102,7 @@ static void test_clamp(uint32_t index) { start(); // Do ~100 M ops - int ct; - for (ct=0; ct < 1000 * 100; ct++) { + for (int ct=0; ct < 1000 * 100; ct++) { for (int i=0; i < (1000); i++) { data_f1[i] = clamp(data_f1[i], -1.f, 1.f); } @@ -114,7 +113,7 @@ static void test_clamp(uint32_t index) { start(); // Do ~100 M ops - for (ct=0; ct < 1000 * 100; ct++) { + for (int ct=0; ct < 1000 * 100; ct++) { for (int i=0; i < (1000); i++) { if (data_f1[i] < -1.f) data_f1[i] = -1.f; if (data_f1[i] > -1.f) data_f1[i] = 1.f; @@ -130,8 +129,7 @@ static void test_clamp4(uint32_t index) { float total = 0; // Do ~100 M ops - int ct; - for (ct=0; ct < 1000 * 100 /4; ct++) { + for (int ct=0; ct < 1000 * 100 /4; ct++) { for (int i=0; i < (1000); i++) { data_f4[i] = clamp(data_f4[i], -1.f, 1.f); } diff --git a/libs/rs/java/tests/src/com/android/rs/test/math.rs b/libs/rs/java/tests/src/com/android/rs/test/math.rs index 5b1ad15..3ff7910 100644 --- a/libs/rs/java/tests/src/com/android/rs/test/math.rs +++ b/libs/rs/java/tests/src/com/android/rs/test/math.rs @@ -7,37 +7,154 @@ volatile float2 f2; volatile float3 f3; volatile float4 f4; -#define TEST_F(fnc, var) \ +volatile int i1; +volatile int2 i2; +volatile int3 i3; +volatile int4 i4; + +#define TEST_FN_FUNC_FN(fnc) \ + rsDebug("Testing " #fnc, 0); \ + f1 = fnc(f1); \ + f2 = fnc(f2); \ + f3 = fnc(f3); \ + f4 = fnc(f4); + +#define TEST_FN_FUNC_FN_PFN(fnc) \ + rsDebug("Testing " #fnc, 0); \ + f1 = fnc(f1, (float*) &f1); \ + f2 = fnc(f2, (float2*) &f2); \ + f3 = fnc(f3, (float3*) &f3); \ + f4 = fnc(f4, (float4*) &f4); + +#define TEST_FN_FUNC_FN_FN(fnc) \ + rsDebug("Testing " #fnc, 0); \ + f1 = fnc(f1, f1); \ + f2 = fnc(f2, f2); \ + f3 = fnc(f3, f3); \ + f4 = fnc(f4, f4); + +#define TEST_FN_FUNC_FN_F(fnc) \ + rsDebug("Testing " #fnc, 0); \ + f1 = fnc(f1, f1); \ + f2 = fnc(f2, f1); \ + f3 = fnc(f3, f1); \ + f4 = fnc(f4, f1); + +#define TEST_FN_FUNC_FN_IN(fnc) \ rsDebug("Testing " #fnc, 0); \ - var##1 = fnc(var##1); \ - var##2 = fnc(var##2); \ - var##3 = fnc(var##3); \ - var##4 = fnc(var##4); + f1 = fnc(f1, i1); \ + f2 = fnc(f2, i2); \ + f3 = fnc(f3, i3); \ + f4 = fnc(f4, i4); -#define TEST_FP(fnc, var) \ +#define TEST_FN_FUNC_FN_I(fnc) \ rsDebug("Testing " #fnc, 0); \ - var##1 = fnc(var##1, (float*) &f1); \ - var##2 = fnc(var##2, (float2*) &f2); \ - var##3 = fnc(var##3, (float3*) &f3); \ - var##4 = fnc(var##4, (float4*) &f4); + f1 = fnc(f1, i1); \ + f2 = fnc(f2, i1); \ + f3 = fnc(f3, i1); \ + f4 = fnc(f4, i1); -#define TEST_F2(fnc, var) \ +#define TEST_FN_FUNC_FN_FN_FN(fnc) \ rsDebug("Testing " #fnc, 0); \ - var##1 = fnc(var##1, var##1); \ - var##2 = fnc(var##2, var##2); \ - var##3 = fnc(var##3, var##3); \ - var##4 = fnc(var##4, var##4); + f1 = fnc(f1, f1, f1); \ + f2 = fnc(f2, f2, f2); \ + f3 = fnc(f3, f3, f3); \ + f4 = fnc(f4, f4, f4); + +#define TEST_FN_FUNC_FN_PIN(fnc) \ + rsDebug("Testing " #fnc, 0); \ + f1 = fnc(f1, (int*) &i1); \ + f2 = fnc(f2, (int2*) &i2); \ + f3 = fnc(f3, (int3*) &i3); \ + f4 = fnc(f4, (int4*) &i4); + +#define TEST_FN_FUNC_FN_FN_PIN(fnc) \ + rsDebug("Testing " #fnc, 0); \ + f1 = fnc(f1, f1, (int*) &i1); \ + f2 = fnc(f2, f2, (int2*) &i2); \ + f3 = fnc(f3, f3, (int3*) &i3); \ + f4 = fnc(f4, f4, (int4*) &i4); + +#define TEST_IN_FUNC_FN(fnc) \ + rsDebug("Testing " #fnc, 0); \ + i1 = fnc(f1); \ + i2 = fnc(f2); \ + i3 = fnc(f3); \ + i4 = fnc(f4); + static bool test_math(uint32_t index) { bool failed = false; start(); - TEST_F(cos, f); - TEST_FP(modf, f); - TEST_F2(pow, f); - TEST_F(sin, f); - TEST_F(sqrt, f); - + TEST_FN_FUNC_FN(acos); + TEST_FN_FUNC_FN(acosh); + TEST_FN_FUNC_FN(acospi); + TEST_FN_FUNC_FN(asin); + TEST_FN_FUNC_FN(asinh); + TEST_FN_FUNC_FN(asinpi); + TEST_FN_FUNC_FN(atan); + TEST_FN_FUNC_FN_FN(atan2); + TEST_FN_FUNC_FN(atanh); + TEST_FN_FUNC_FN(atanpi); + TEST_FN_FUNC_FN_FN(atan2pi); + TEST_FN_FUNC_FN(cbrt); + TEST_FN_FUNC_FN(ceil); + TEST_FN_FUNC_FN_FN(copysign); + TEST_FN_FUNC_FN(cos); + TEST_FN_FUNC_FN(cosh); + TEST_FN_FUNC_FN(cospi); + TEST_FN_FUNC_FN(erfc); + TEST_FN_FUNC_FN(erf); + TEST_FN_FUNC_FN(exp); + TEST_FN_FUNC_FN(exp2); + TEST_FN_FUNC_FN(exp10); + TEST_FN_FUNC_FN(expm1); + TEST_FN_FUNC_FN(fabs); + TEST_FN_FUNC_FN_FN(fdim); + TEST_FN_FUNC_FN(floor); + TEST_FN_FUNC_FN_FN_FN(fma); + TEST_FN_FUNC_FN_FN(fmax); + TEST_FN_FUNC_FN_F(fmax); + TEST_FN_FUNC_FN_FN(fmin); + TEST_FN_FUNC_FN_F(fmin); + TEST_FN_FUNC_FN_FN(fmod); + TEST_FN_FUNC_FN_PFN(fract); + TEST_FN_FUNC_FN_PIN(frexp); + TEST_FN_FUNC_FN_FN(hypot); + TEST_IN_FUNC_FN(ilogb); + TEST_FN_FUNC_FN_IN(ldexp); + TEST_FN_FUNC_FN_I(ldexp); + TEST_FN_FUNC_FN(lgamma); + TEST_FN_FUNC_FN_PIN(lgamma); + TEST_FN_FUNC_FN(log); + TEST_FN_FUNC_FN(log2); + TEST_FN_FUNC_FN(log10); + TEST_FN_FUNC_FN(log1p); + TEST_FN_FUNC_FN(logb); + TEST_FN_FUNC_FN_FN_FN(mad); + TEST_FN_FUNC_FN_PFN(modf); + // nan + TEST_FN_FUNC_FN_FN(nextafter); + TEST_FN_FUNC_FN_FN(pow); + TEST_FN_FUNC_FN_IN(pown); + TEST_FN_FUNC_FN_FN(powr); + TEST_FN_FUNC_FN_FN(remainder); + TEST_FN_FUNC_FN_FN_PIN(remquo); + TEST_FN_FUNC_FN(rint); + TEST_FN_FUNC_FN_IN(rootn); + TEST_FN_FUNC_FN(round); + TEST_FN_FUNC_FN(rsqrt); + TEST_FN_FUNC_FN(sin); + TEST_FN_FUNC_FN_PFN(sincos); + TEST_FN_FUNC_FN(sinh); + TEST_FN_FUNC_FN(sinpi); + TEST_FN_FUNC_FN(sqrt); + TEST_FN_FUNC_FN(tan); + TEST_FN_FUNC_FN(tanh); + TEST_FN_FUNC_FN(tanpi); + TEST_FN_FUNC_FN(tgamma); + TEST_FN_FUNC_FN(trunc); float time = end(index); diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 98f30ae..3acb624 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -1039,9 +1039,7 @@ void rsi_ContextDump(Context *rsc, int32_t bits) { } void rsi_ContextDestroyWorker(Context *rsc) { - LOGE("rsi_ContextDestroyWorker 1"); rsc->destroyWorkerThreadResources();; - LOGE("rsi_ContextDestroyWorker 2"); } } diff --git a/libs/rs/rsScriptC_LibCL.cpp b/libs/rs/rsScriptC_LibCL.cpp index 28c558d..65b5ff4 100644 --- a/libs/rs/rsScriptC_LibCL.cpp +++ b/libs/rs/rsScriptC_LibCL.cpp @@ -58,6 +58,10 @@ static float SC_log2(float v) { return log10(v) / log10(2.f); } +static float SC_mad(float v1, float v2, float v3) { + return v1 * v2 + v3; +} + static float SC_pown(float v, int p) { return powf(v, (float)p); } @@ -188,6 +192,7 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "_Z6asinpif", (void *)&SC_asinpi, true }, { "_Z4atanf", (void *)&atanf, true }, { "_Z5atan2ff", (void *)&atan2f, true }, + { "_Z5atanhf", (void *)&atanhf, true }, { "_Z6atanpif", (void *)&SC_atanpi, true }, { "_Z7atan2piff", (void *)&SC_atan2pi, true }, { "_Z4cbrtf", (void *)&cbrtf, true }, @@ -215,33 +220,32 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "_Z5ilogbf", (void *)&ilogbf, true }, { "_Z5ldexpfi", (void *)&ldexpf, true }, { "_Z6lgammaf", (void *)&lgammaf, true }, + { "_Z6lgammafPi", (void *)&lgammaf_r, true }, { "_Z3logf", (void *)&logf, true }, { "_Z4log2f", (void *)&SC_log2, true }, { "_Z5log10f", (void *)&log10f, true }, { "_Z5log1pf", (void *)&log1pf, true }, - //{ "logb", (void *)&, true }, - //{ "mad", (void *)&, true }, + { "_Z4logbf", (void *)&logbf, true }, + { "_Z3madfff", (void *)&SC_mad, true }, { "_Z4modffPf", (void *)&modff, true }, //{ "nan", (void *)&, true }, { "_Z9nextafterff", (void *)&nextafterf, true }, { "_Z3powff", (void *)&powf, true }, - { "_Z4pownfi", (void *)&SC_pown, true }, - { "_Z4powrff", (void *)&SC_powr, true }, { "_Z9remainderff", (void *)&remainderf, true }, - { "remquo", (void *)&remquof, true }, + { "_Z6remquoffPi", (void *)&remquof, true }, { "_Z4rintf", (void *)&rintf, true }, { "_Z5rootnfi", (void *)&SC_rootn, true }, { "_Z5roundf", (void *)&roundf, true }, { "_Z5rsqrtf", (void *)&SC_rsqrt, true }, { "_Z3sinf", (void *)&sinf, true }, - { "sincos", (void *)&SC_sincos, true }, + { "_Z6sincosfPf", (void *)&SC_sincos, true }, { "_Z4sinhf", (void *)&sinhf, true }, { "_Z5sinpif", (void *)&SC_sinpi, true }, { "_Z4sqrtf", (void *)&sqrtf, true }, { "_Z3tanf", (void *)&tanf, true }, { "_Z4tanhf", (void *)&tanhf, true }, { "_Z5tanpif", (void *)&SC_tanpi, true }, - //{ "tgamma", (void *)&, true }, + { "_Z6tgammaf", (void *)&lgammaf, true }, // FIXME!!! NEEDS TO USE tgammaf { "_Z5truncf", (void *)&truncf, true }, // OpenCL Int diff --git a/libs/rs/scriptc/rs_cl.rsh b/libs/rs/scriptc/rs_cl.rsh index ab8270f..a7e46d8 100644 --- a/libs/rs/scriptc/rs_cl.rsh +++ b/libs/rs/scriptc/rs_cl.rsh @@ -42,7 +42,7 @@ CVT_FUNC(float) // Float ops, 6.11.2 -#define DEF_FUNC_1(fnc) \ +#define FN_FUNC_FN(fnc) \ _RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v) { \ float2 r; \ r.x = fnc(v.x); \ @@ -65,7 +65,7 @@ _RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v) { \ return r; \ } -#define DEF_FUNC_1_RI(fnc) \ +#define IN_FUNC_FN(fnc) \ _RS_STATIC int2 __attribute__((overloadable)) fnc(float2 v) { \ int2 r; \ r.x = fnc(v.x); \ @@ -88,7 +88,7 @@ _RS_STATIC int4 __attribute__((overloadable)) fnc(float4 v) { \ return r; \ } -#define DEF_FUNC_2(fnc) \ +#define FN_FUNC_FN_FN(fnc) \ _RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2) { \ float2 r; \ r.x = fnc(v1.x, v2.x); \ @@ -111,7 +111,7 @@ _RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2) { \ return r; \ } -#define DEF_FUNC_2F(fnc) \ +#define FN_FUNC_FN_F(fnc) \ _RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float v2) { \ float2 r; \ r.x = fnc(v1.x, v2); \ @@ -134,7 +134,53 @@ _RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float v2) { \ return r; \ } -#define DEF_FUNC_2P(fnc) \ +#define FN_FUNC_FN_IN(fnc) \ +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2) { \ + float2 r; \ + r.x = fnc(v1.x, v2.x); \ + r.y = fnc(v1.y, v2.y); \ + return r; \ +} \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2) { \ + float3 r; \ + r.x = fnc(v1.x, v2.x); \ + r.y = fnc(v1.y, v2.y); \ + r.z = fnc(v1.z, v2.z); \ + return r; \ +} \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2) { \ + float4 r; \ + r.x = fnc(v1.x, v2.x); \ + r.y = fnc(v1.y, v2.y); \ + r.z = fnc(v1.z, v2.z); \ + r.w = fnc(v1.w, v2.w); \ + return r; \ +} + +#define FN_FUNC_FN_I(fnc) \ +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int v2) { \ + float2 r; \ + r.x = fnc(v1.x, v2); \ + r.y = fnc(v1.y, v2); \ + return r; \ +} \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int v2) { \ + float3 r; \ + r.x = fnc(v1.x, v2); \ + r.y = fnc(v1.y, v2); \ + r.z = fnc(v1.z, v2); \ + return r; \ +} \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int v2) { \ + float4 r; \ + r.x = fnc(v1.x, v2); \ + r.y = fnc(v1.y, v2); \ + r.z = fnc(v1.z, v2); \ + r.w = fnc(v1.w, v2); \ + return r; \ +} + +#define FN_FUNC_FN_PFN(fnc) \ _RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 *v2) { \ float2 r; \ float q; \ @@ -169,112 +215,205 @@ _RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 *v2) { \ return r; \ } +#define FN_FUNC_FN_PIN(fnc) \ +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2) { \ + float2 r; \ + int q; \ + r.x = fnc(v1.x, &q); \ + v2->x = q; \ + r.y = fnc(v1.y, &q); \ + v2->y = q; \ + return r; \ +} \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2) { \ + float3 r; \ + int q; \ + r.x = fnc(v1.x, &q); \ + v2->x = q; \ + r.y = fnc(v1.y, &q); \ + v2->y = q; \ + r.z = fnc(v1.z, &q); \ + v2->z = q; \ + return r; \ +} \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2) { \ + float4 r; \ + int q; \ + r.x = fnc(v1.x, &q); \ + v2->x = q; \ + r.y = fnc(v1.y, &q); \ + v2->y = q; \ + r.z = fnc(v1.z, &q); \ + v2->z = q; \ + r.w = fnc(v1.w, &q); \ + v2->w = q; \ + return r; \ +} + +#define FN_FUNC_FN_FN_FN(fnc) \ +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2, float2 v3) { \ + float2 r; \ + r.x = fnc(v1.x, v2.x, v3.x); \ + r.y = fnc(v1.y, v2.y, v3.y); \ + return r; \ +} \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2, float3 v3) { \ + float3 r; \ + r.x = fnc(v1.x, v2.x, v3.x); \ + r.y = fnc(v1.y, v2.y, v3.y); \ + r.z = fnc(v1.z, v2.z, v3.z); \ + return r; \ +} \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2, float4 v3) { \ + float4 r; \ + r.x = fnc(v1.x, v2.x, v3.x); \ + r.y = fnc(v1.y, v2.y, v3.y); \ + r.z = fnc(v1.z, v2.z, v3.z); \ + r.w = fnc(v1.w, v2.w, v3.w); \ + return r; \ +} + +#define FN_FUNC_FN_FN_PIN(fnc) \ +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2, int2 *v3) { \ + float2 r; \ + int q; \ + r.x = fnc(v1.x, v2.x, &q); \ + v3->x = q; \ + r.y = fnc(v1.y, v2.y, &q); \ + v3->y = q; \ + return r; \ +} \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2, int3 *v3) { \ + float3 r; \ + int q; \ + r.x = fnc(v1.x, v2.x, &q); \ + v3->x = q; \ + r.y = fnc(v1.y, v2.y, &q); \ + v3->y = q; \ + r.z = fnc(v1.z, v2.z, &q); \ + v3->z = q; \ + return r; \ +} \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2, int4 *v3) { \ + float4 r; \ + int q; \ + r.x = fnc(v1.x, v2.x, &q); \ + v3->x = q; \ + r.y = fnc(v1.y, v2.y, &q); \ + v3->y = q; \ + r.z = fnc(v1.z, v2.z, &q); \ + v3->z = q; \ + r.w = fnc(v1.w, v2.w, &q); \ + v3->w = q; \ + return r; \ +} + + + extern float __attribute__((overloadable)) acos(float); -DEF_FUNC_1(acos) +FN_FUNC_FN(acos) extern float __attribute__((overloadable)) acosh(float); -DEF_FUNC_1(acosh) +FN_FUNC_FN(acosh) _RS_STATIC float __attribute__((overloadable)) acospi(float v) { return acos(v) / M_PI; } -DEF_FUNC_1(acospi) +FN_FUNC_FN(acospi) extern float __attribute__((overloadable)) asin(float); -DEF_FUNC_1(asin) +FN_FUNC_FN(asin) extern float __attribute__((overloadable)) asinh(float); -DEF_FUNC_1(asinh) +FN_FUNC_FN(asinh) _RS_STATIC float __attribute__((overloadable)) asinpi(float v) { return asin(v) / M_PI; } -DEF_FUNC_1(asinpi) +FN_FUNC_FN(asinpi) extern float __attribute__((overloadable)) atan(float); -DEF_FUNC_1(atan) +FN_FUNC_FN(atan) extern float __attribute__((overloadable)) atan2(float, float); -DEF_FUNC_2(atan2) +FN_FUNC_FN_FN(atan2) extern float __attribute__((overloadable)) atanh(float); -DEF_FUNC_1(atanh) +FN_FUNC_FN(atanh) _RS_STATIC float __attribute__((overloadable)) atanpi(float v) { return atan(v) / M_PI; } -DEF_FUNC_1(atanpi) +FN_FUNC_FN(atanpi) _RS_STATIC float __attribute__((overloadable)) atan2pi(float y, float x) { return atan2(y, x) / M_PI; } -DEF_FUNC_2(atan2pi) +FN_FUNC_FN_FN(atan2pi) extern float __attribute__((overloadable)) cbrt(float); -DEF_FUNC_1(cbrt) +FN_FUNC_FN(cbrt) extern float __attribute__((overloadable)) ceil(float); -DEF_FUNC_1(ceil) +FN_FUNC_FN(ceil) extern float __attribute__((overloadable)) copysign(float, float); -DEF_FUNC_2(copysign) +FN_FUNC_FN_FN(copysign) extern float __attribute__((overloadable)) cos(float); -DEF_FUNC_1(cos) +FN_FUNC_FN(cos) extern float __attribute__((overloadable)) cosh(float); -DEF_FUNC_1(cosh) +FN_FUNC_FN(cosh) _RS_STATIC float __attribute__((overloadable)) cospi(float v) { return cos(v * M_PI); } -DEF_FUNC_1(cospi) +FN_FUNC_FN(cospi) extern float __attribute__((overloadable)) erfc(float); -DEF_FUNC_1(erfc) +FN_FUNC_FN(erfc) extern float __attribute__((overloadable)) erf(float); -DEF_FUNC_1(erf) +FN_FUNC_FN(erf) extern float __attribute__((overloadable)) exp(float); -DEF_FUNC_1(exp) +FN_FUNC_FN(exp) extern float __attribute__((overloadable)) exp2(float); -DEF_FUNC_1(exp2) +FN_FUNC_FN(exp2) extern float __attribute__((overloadable)) pow(float, float); _RS_STATIC float __attribute__((overloadable)) exp10(float v) { return pow(10.f, v); } -DEF_FUNC_1(exp10) +FN_FUNC_FN(exp10) extern float __attribute__((overloadable)) expm1(float); -DEF_FUNC_1(expm1) +FN_FUNC_FN(expm1) extern float __attribute__((overloadable)) fabs(float); -DEF_FUNC_1(fabs) +FN_FUNC_FN(fabs) extern float __attribute__((overloadable)) fdim(float, float); -DEF_FUNC_2(fdim) +FN_FUNC_FN_FN(fdim) extern float __attribute__((overloadable)) floor(float); -DEF_FUNC_1(floor) +FN_FUNC_FN(floor) extern float __attribute__((overloadable)) fma(float, float, float); -extern float2 __attribute__((overloadable)) fma(float2, float2, float2); -extern float3 __attribute__((overloadable)) fma(float3, float3, float3); -extern float4 __attribute__((overloadable)) fma(float4, float4, float4); +FN_FUNC_FN_FN_FN(fma) extern float __attribute__((overloadable)) fmax(float, float); -DEF_FUNC_2(fmax); -DEF_FUNC_2F(fmax); +FN_FUNC_FN_FN(fmax); +FN_FUNC_FN_F(fmax); extern float __attribute__((overloadable)) fmin(float, float); -DEF_FUNC_2(fmin); -DEF_FUNC_2F(fmin); +FN_FUNC_FN_FN(fmin); +FN_FUNC_FN_F(fmin); extern float __attribute__((overloadable)) fmod(float, float); -DEF_FUNC_2(fmod) +FN_FUNC_FN_FN(fmod) _RS_STATIC float __attribute__((overloadable)) fract(float v, float *iptr) { int i = (int)floor(v); @@ -315,64 +454,54 @@ _RS_STATIC float4 __attribute__((overloadable)) fract(float4 v, float4 *iptr) { return r; } -extern float __attribute__((overloadable)) frexp(float, float *); -extern float2 __attribute__((overloadable)) frexp(float2, float2 *); -extern float3 __attribute__((overloadable)) frexp(float3, float3 *); -extern float4 __attribute__((overloadable)) frexp(float4, float4 *); +extern float __attribute__((overloadable)) frexp(float, int *); +FN_FUNC_FN_PIN(frexp) extern float __attribute__((overloadable)) hypot(float, float); -DEF_FUNC_2(hypot) +FN_FUNC_FN_FN(hypot) extern int __attribute__((overloadable)) ilogb(float); -DEF_FUNC_1_RI(ilogb) +IN_FUNC_FN(ilogb) extern float __attribute__((overloadable)) ldexp(float, int); -extern float2 __attribute__((overloadable)) ldexp(float2, int2); -extern float3 __attribute__((overloadable)) ldexp(float3, int3); -extern float4 __attribute__((overloadable)) ldexp(float4, int4); -extern float2 __attribute__((overloadable)) ldexp(float2, int); -extern float3 __attribute__((overloadable)) ldexp(float3, int); -extern float4 __attribute__((overloadable)) ldexp(float4, int); +FN_FUNC_FN_IN(ldexp) +FN_FUNC_FN_I(ldexp) extern float __attribute__((overloadable)) lgamma(float); -DEF_FUNC_1(lgamma) -extern float __attribute__((overloadable)) lgamma(float, float *); -extern float2 __attribute__((overloadable)) lgamma(float2, float2 *); -extern float3 __attribute__((overloadable)) lgamma(float3, float3 *); -extern float4 __attribute__((overloadable)) lgamma(float4, float4 *); +FN_FUNC_FN(lgamma) +extern float __attribute__((overloadable)) lgamma(float, int*); +FN_FUNC_FN_PIN(lgamma) extern float __attribute__((overloadable)) log(float); -DEF_FUNC_1(log) +FN_FUNC_FN(log) extern float __attribute__((overloadable)) log10(float); -DEF_FUNC_1(log10) +FN_FUNC_FN(log10) _RS_STATIC float __attribute__((overloadable)) log2(float v) { return log10(v) / log10(2.f); } -DEF_FUNC_1(log2) +FN_FUNC_FN(log2) extern float __attribute__((overloadable)) log1p(float); -DEF_FUNC_1(log1p) +FN_FUNC_FN(log1p) extern float __attribute__((overloadable)) logb(float); -DEF_FUNC_1(logb) +FN_FUNC_FN(logb) extern float __attribute__((overloadable)) mad(float, float, float); -extern float2 __attribute__((overloadable)) mad(float2, float2, float2); -extern float3 __attribute__((overloadable)) mad(float3, float3, float3); -extern float4 __attribute__((overloadable)) mad(float4, float4, float4); +FN_FUNC_FN_FN_FN(mad) extern float __attribute__((overloadable)) modf(float, float *); -DEF_FUNC_2P(modf); +FN_FUNC_FN_PFN(modf); //extern float __attribute__((overloadable)) nan(uint); extern float __attribute__((overloadable)) nextafter(float, float); -DEF_FUNC_2(nextafter) +FN_FUNC_FN_FN(nextafter) -DEF_FUNC_2(pow) +FN_FUNC_FN_FN(pow) _RS_STATIC float __attribute__((overloadable)) pown(float v, int p) { return pow(v, (float)p); @@ -401,15 +530,13 @@ _RS_STATIC float4 __attribute__((overloadable)) powr(float4 v, float4 p) { } extern float __attribute__((overloadable)) remainder(float, float); -DEF_FUNC_2(remainder) +FN_FUNC_FN_FN(remainder) extern float __attribute__((overloadable)) remquo(float, float, int *); -extern float2 __attribute__((overloadable)) remquo(float2, float2, int2 *); -extern float3 __attribute__((overloadable)) remquo(float3, float3, int3 *); -extern float4 __attribute__((overloadable)) remquo(float4, float4, int4 *); +FN_FUNC_FN_FN_PIN(remquo) extern float __attribute__((overloadable)) rint(float); -DEF_FUNC_1(rint) +FN_FUNC_FN(rint) _RS_STATIC float __attribute__((overloadable)) rootn(float v, int r) { return pow(v, 1.f / r); @@ -428,16 +555,16 @@ _RS_STATIC float4 __attribute__((overloadable)) rootn(float4 v, int4 r) { } extern float __attribute__((overloadable)) round(float); -DEF_FUNC_1(round) +FN_FUNC_FN(round) extern float __attribute__((overloadable)) sqrt(float); _RS_STATIC float __attribute__((overloadable)) rsqrt(float v) { return 1.f / sqrt(v); } -DEF_FUNC_1(rsqrt) +FN_FUNC_FN(rsqrt) extern float __attribute__((overloadable)) sin(float); -DEF_FUNC_1(sin) +FN_FUNC_FN(sin) _RS_STATIC float __attribute__((overloadable)) sincos(float v, float *cosptr) { *cosptr = cos(v); @@ -457,35 +584,35 @@ _RS_STATIC float4 __attribute__((overloadable)) sincos(float4 v, float4 *cosptr) } extern float __attribute__((overloadable)) sinh(float); -DEF_FUNC_1(sinh) +FN_FUNC_FN(sinh) _RS_STATIC float __attribute__((overloadable)) sinpi(float v) { return sin(v * M_PI); } -DEF_FUNC_1(sinpi) +FN_FUNC_FN(sinpi) -DEF_FUNC_1(sqrt) +FN_FUNC_FN(sqrt) extern float __attribute__((overloadable)) tan(float); -DEF_FUNC_1(tan) +FN_FUNC_FN(tan) extern float __attribute__((overloadable)) tanh(float); -DEF_FUNC_1(tanh) +FN_FUNC_FN(tanh) _RS_STATIC float __attribute__((overloadable)) tanpi(float v) { return tan(v * M_PI); } -DEF_FUNC_1(tanpi) +FN_FUNC_FN(tanpi) extern float __attribute__((overloadable)) tgamma(float); -DEF_FUNC_1(tgamma) +FN_FUNC_FN(tgamma) extern float __attribute__((overloadable)) trunc(float); -DEF_FUNC_1(trunc) +FN_FUNC_FN(trunc) // Int ops (partial), 6.11.3 -#define DEF_RIFUNC_1(typeout, typein, fnc) \ +#define XN_FUNC_YN(typeout, fnc, typein) \ extern typeout __attribute__((overloadable)) fnc(typein); \ _RS_STATIC typeout##2 __attribute__((overloadable)) fnc(typein##2 v) { \ typeout##2 r; \ @@ -509,20 +636,20 @@ _RS_STATIC typeout##4 __attribute__((overloadable)) fnc(typein##4 v) { \ return r; \ } -#define DEF_UIFUNC_1(fnc) \ -DEF_RIFUNC_1(uchar, char, fnc) \ -DEF_RIFUNC_1(ushort, short, fnc) \ -DEF_RIFUNC_1(uint, int, fnc) +#define UIN_FUNC_IN(fnc) \ +XN_FUNC_YN(uchar, fnc, char) \ +XN_FUNC_YN(ushort, fnc, short) \ +XN_FUNC_YN(uint, fnc, int) -#define DEF_IFUNC_1(fnc) \ -DEF_RIFUNC_1(uchar, uchar, fnc) \ -DEF_RIFUNC_1(char, char, fnc) \ -DEF_RIFUNC_1(ushort, ushort, fnc) \ -DEF_RIFUNC_1(short, short, fnc) \ -DEF_RIFUNC_1(uint, uint, fnc) \ -DEF_RIFUNC_1(int, int, fnc) +#define IN_FUNC_IN(fnc) \ +XN_FUNC_YN(uchar, fnc, uchar) \ +XN_FUNC_YN(char, fnc, char) \ +XN_FUNC_YN(ushort, fnc, ushort) \ +XN_FUNC_YN(short, fnc, short) \ +XN_FUNC_YN(uint, fnc, uint) \ +XN_FUNC_YN(int, fnc, int) -#define DEF_RIFUNC_2(type, fnc, body) \ +#define XN_FUNC_XN_XN_BODY(type, fnc, body) \ _RS_STATIC type __attribute__((overloadable)) fnc(type v1, type v2) { \ return body; \ } \ @@ -548,23 +675,23 @@ _RS_STATIC type##4 __attribute__((overloadable)) fnc(type##4 v1, type##4 v2) { return r; \ } \ -#define DEF_IFUNC_2(fnc, body) \ -DEF_RIFUNC_2(uchar, fnc, body) \ -DEF_RIFUNC_2(char, fnc, body) \ -DEF_RIFUNC_2(ushort, fnc, body) \ -DEF_RIFUNC_2(short, fnc, body) \ -DEF_RIFUNC_2(uint, fnc, body) \ -DEF_RIFUNC_2(int, fnc, body) \ -DEF_RIFUNC_2(float, fnc, body) +#define IN_FUNC_IN_IN_BODY(fnc, body) \ +XN_FUNC_XN_XN_BODY(uchar, fnc, body) \ +XN_FUNC_XN_XN_BODY(char, fnc, body) \ +XN_FUNC_XN_XN_BODY(ushort, fnc, body) \ +XN_FUNC_XN_XN_BODY(short, fnc, body) \ +XN_FUNC_XN_XN_BODY(uint, fnc, body) \ +XN_FUNC_XN_XN_BODY(int, fnc, body) \ +XN_FUNC_XN_XN_BODY(float, fnc, body) -DEF_UIFUNC_1(abs) -DEF_IFUNC_1(clz) +UIN_FUNC_IN(abs) +IN_FUNC_IN(clz) -DEF_IFUNC_2(min, (v1 < v2 ? v1 : v2)) -DEF_FUNC_2F(min) +IN_FUNC_IN_IN_BODY(min, (v1 < v2 ? v1 : v2)) +FN_FUNC_FN_F(min) -DEF_IFUNC_2(max, (v1 > v2 ? v1 : v2)) -DEF_FUNC_2F(max) +IN_FUNC_IN_IN_BODY(max, (v1 > v2 ? v1 : v2)) +FN_FUNC_FN_F(max) // 6.11.4 @@ -617,7 +744,7 @@ _RS_STATIC float4 __attribute__((overloadable)) clamp(float4 amount, float low, _RS_STATIC float __attribute__((overloadable)) degrees(float radians) { return radians * (180.f / M_PI); } -DEF_FUNC_1(degrees) +FN_FUNC_FN(degrees) _RS_STATIC float __attribute__((overloadable)) mix(float start, float stop, float amount) { return start + (stop - start) * amount; @@ -644,7 +771,7 @@ _RS_STATIC float4 __attribute__((overloadable)) mix(float4 start, float4 stop, f _RS_STATIC float __attribute__((overloadable)) radians(float degrees) { return degrees * (M_PI / 180.f); } -DEF_FUNC_1(radians) +FN_FUNC_FN(radians) _RS_STATIC float __attribute__((overloadable)) step(float edge, float v) { return (v < edge) ? 0.f : 1.f; @@ -705,7 +832,7 @@ _RS_STATIC float __attribute__((overloadable)) sign(float v) { if (v < 0) return -1.f; return v; } -DEF_FUNC_1(sign) +FN_FUNC_FN(sign) // 6.11.5 _RS_STATIC float3 __attribute__((overloadable)) cross(float3 lhs, float3 rhs) { @@ -779,15 +906,21 @@ _RS_STATIC float4 __attribute__((overloadable)) normalize(float4 v) { #undef CVT_FUNC #undef CVT_FUNC_2 -#undef DEF_FUNC_1 -#undef DEF_FUNC_1_RI -#undef DEF_FUNC_2 -#undef DEF_FUNC_2F -#undef DEF_RIFUNC_1 -#undef DEF_UIFUNC_1 -#undef DEF_IFUNC_1 -#undef DEF_RIFUNC_2 -#undef DEF_IFUNC_2 +#undef FN_FUNC_FN +#undef IN_FUNC_FN +#undef FN_FUNC_FN_FN +#undef FN_FUNC_FN_F +#undef FN_FUNC_FN_IN +#undef FN_FUNC_FN_I +#undef FN_FUNC_FN_PFN +#undef FN_FUNC_FN_PIN +#undef FN_FUNC_FN_FN_FN +#undef FN_FUNC_FN_FN_PIN +#undef XN_FUNC_YN +#undef UIN_FUNC_IN +#undef IN_FUNC_IN +#undef XN_FUNC_XN_XN_BODY +#undef IN_FUNC_IN_IN_BODY #undef _RS_STATIC #endif diff --git a/libs/ui/EGLUtils.cpp b/libs/ui/EGLUtils.cpp index 1663313..f24a71d 100644 --- a/libs/ui/EGLUtils.cpp +++ b/libs/ui/EGLUtils.cpp @@ -66,12 +66,6 @@ status_t EGLUtils::selectConfigForPixelFormat( if (outConfig == NULL) return BAD_VALUE; - int err; - PixelFormatInfo fbFormatInfo; - if ((err = getPixelFormatInfo(PixelFormat(format), &fbFormatInfo)) < 0) { - return err; - } - // Get all the "potential match" configs... if (eglGetConfigs(dpy, NULL, 0, &numConfigs) == EGL_FALSE) return BAD_VALUE; @@ -81,23 +75,14 @@ status_t EGLUtils::selectConfigForPixelFormat( free(configs); return BAD_VALUE; } - - const int fbSzA = fbFormatInfo.getSize(PixelFormatInfo::INDEX_ALPHA); - const int fbSzR = fbFormatInfo.getSize(PixelFormatInfo::INDEX_RED); - const int fbSzG = fbFormatInfo.getSize(PixelFormatInfo::INDEX_GREEN); - const int fbSzB = fbFormatInfo.getSize(PixelFormatInfo::INDEX_BLUE); int i; EGLConfig config = NULL; for (i=0 ; i<n ; i++) { - EGLint r,g,b,a; - EGLConfig curr = configs[i]; - eglGetConfigAttrib(dpy, curr, EGL_RED_SIZE, &r); - eglGetConfigAttrib(dpy, curr, EGL_GREEN_SIZE, &g); - eglGetConfigAttrib(dpy, curr, EGL_BLUE_SIZE, &b); - eglGetConfigAttrib(dpy, curr, EGL_ALPHA_SIZE, &a); - if (fbSzA == a && fbSzR == r && fbSzG == g && fbSzB == b) { - config = curr; + EGLint nativeVisualId = 0; + eglGetConfigAttrib(dpy, configs[i], EGL_NATIVE_VISUAL_ID, &nativeVisualId); + if (nativeVisualId>0 && format == nativeVisualId) { + config = configs[i]; break; } } diff --git a/packages/SystemUI/assets/fonts/AndroidClock.ttf b/packages/SystemUI/assets/fonts/AndroidClock.ttf Binary files differindex 3945183..7b550ee 100644 --- a/packages/SystemUI/assets/fonts/AndroidClock.ttf +++ b/packages/SystemUI/assets/fonts/AndroidClock.ttf diff --git a/packages/SystemUI/assets/fonts/AndroidClock2.ttf b/packages/SystemUI/assets/fonts/AndroidClock2.ttf Binary files differindex fa0221e..a95d548 100644 --- a/packages/SystemUI/assets/fonts/AndroidClock2.ttf +++ b/packages/SystemUI/assets/fonts/AndroidClock2.ttf diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_default.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_default.png Binary files differnew file mode 100644 index 0000000..9812339 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_default.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_default.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_default.png Binary files differnew file mode 100644 index 0000000..4f61511 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_default.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_pressed.png Binary files differnew file mode 100644 index 0000000..4757125 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_pressed.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_pressed.png Binary files differnew file mode 100644 index 0000000..8436f5a --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_pressed.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_default.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_default.png Binary files differnew file mode 100644 index 0000000..6005075 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_default.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_pressed.png Binary files differnew file mode 100644 index 0000000..83068a9 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_pressed.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_pressed.png Binary files differnew file mode 100644 index 0000000..e6f2f34 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_pressed.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_menu_default.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_menu_default.png Binary files differnew file mode 100644 index 0000000..2591521 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_menu_default.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_menu_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_menu_pressed.png Binary files differnew file mode 100644 index 0000000..56a4a1d --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_menu_pressed.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_recent_default.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_recent_default.png Binary files differnew file mode 100644 index 0000000..7754657 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_recent_default.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_recent_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_recent_pressed.png Binary files differnew file mode 100644 index 0000000..afc4057 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_recent_pressed.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png Binary files differindex dadb0cd..92ffde9 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_pressed.png Binary files differindex 51d7cc2..0cd05a3 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_pressed.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_pressed.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_pressed.png Binary files differindex 3359602..993ea55 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_pressed.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_pressed.png diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_bg.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..22d6c79 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/notify_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_bg_protect.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_bg_protect.png Binary files differnew file mode 100644 index 0000000..24166da --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/notify_panel_bg_protect.png diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg.9.png Binary files differnew file mode 100644 index 0000000..85d9795 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_notify_bg.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_notify_bg.9.png Binary files differnew file mode 100644 index 0000000..b389a35 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/notify_panel_notify_bg.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/panel_notification.png b/packages/SystemUI/res/drawable-mdpi/panel_notification.png Binary files differnew file mode 100644 index 0000000..3789f3c --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/panel_notification.png diff --git a/packages/SystemUI/res/drawable-nodpi/notify_panel_bg_protect.png b/packages/SystemUI/res/drawable-nodpi/notify_panel_bg_protect.png Binary files differdeleted file mode 100755 index e9589d9..0000000 --- a/packages/SystemUI/res/drawable-nodpi/notify_panel_bg_protect.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable/notify_panel_bg_protect_tiled.xml b/packages/SystemUI/res/drawable/notify_panel_bg_protect_tiled.xml new file mode 100644 index 0000000..0371322 --- /dev/null +++ b/packages/SystemUI/res/drawable/notify_panel_bg_protect_tiled.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<bitmap + xmlns:android="http://schemas.android.com/apk/res/android" + android:src="@drawable/notify_panel_bg_protect" + android:tileMode="repeat" + /> + diff --git a/packages/SystemUI/res/drawable/status_bar_item_background.xml b/packages/SystemUI/res/drawable/status_bar_item_background.xml index 9da92a7..3a50aa9 100644 --- a/packages/SystemUI/res/drawable/status_bar_item_background.xml +++ b/packages/SystemUI/res/drawable/status_bar_item_background.xml @@ -20,7 +20,6 @@ > <item android:drawable="@drawable/notification_item_background_color" - android:left="16dp" /> </layer-list> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml index 7f84b21..26e045c 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml @@ -25,8 +25,8 @@ <View android:id="@+id/scrim" - android:background="@drawable/notify_panel_bg_protect" - android:layout_width="match_parent" + android:background="@drawable/notify_panel_bg_protect_tiled" + android:layout_width="512dp" android:layout_height="match_parent" android:layout_alignParentTop="true" android:layout_alignParentRight="true" @@ -35,142 +35,27 @@ <RelativeLayout android:id="@+id/content_parent" android:layout_height="wrap_content" - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" > - <RelativeLayout - android:id="@+id/title_area" - android:layout_height="160dp" - android:layout_width="384dp" - android:layout_marginLeft="24dp" - android:paddingTop="20dp" - android:orientation="vertical" + + <include layout="@layout/status_bar_notification_panel_title" + android:layout_width="471dp" + android:layout_height="465dp" android:layout_alignParentTop="true" android:layout_alignParentRight="true" - android:background="@drawable/panel_notification_tiled" - > - - <com.android.systemui.statusbar.tablet.HoloClock - android:id="@+id/clock" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_alignParentTop="true" - android:layout_marginRight="40dip" - android:layout_marginBottom="4dip" - > - <TextView android:id="@+id/time_bg" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:gravity="right" - android:singleLine="true" - android:textSize="90dip" - android:textColor="#999999" /> - <TextView android:id="@+id/time_fg" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:gravity="right" - android:singleLine="true" - android:textSize="90dip" - android:textColor="#666666" /> - </com.android.systemui.statusbar.tablet.HoloClock> - - <com.android.systemui.statusbar.policy.DateView - android:id="@+id/date" - style="@style/StatusBarNotificationText" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_below="@id/clock" - android:layout_marginTop="4dp" - android:layout_marginRight="48dp" - android:gravity="right" - /> - - <ImageView - android:id="@+id/battery" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_alignParentLeft="true" - android:layout_below="@id/date" - android:layout_marginLeft="48dp" - android:layout_marginTop="18dp" - android:layout_marginRight="8dp" - android:baseline="15dp" - /> - - <TextView - android:id="@+id/battery_text" - style="@style/StatusBarNotificationText" - android:layout_width="56dp" - android:layout_height="wrap_content" - android:layout_toRightOf="@id/battery" - android:layout_alignBaseline="@id/battery" - android:singleLine="true" - android:text="@string/status_bar_settings_settings_button" - /> - - <ImageView - android:id="@+id/network_signal" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_toRightOf="@id/battery_text" - android:layout_alignBaseline="@id/battery" - android:layout_marginRight="8dp" - android:baseline="15dp" - /> - - <ImageView - android:id="@+id/network_type" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_toRightOf="@id/battery_text" - android:layout_alignBaseline="@id/battery" - android:layout_marginRight="8dp" - android:baseline="15dp" - /> - - <TextView - android:id="@+id/network_text" - style="@style/StatusBarNotificationText" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toRightOf="@id/network_signal" - android:layout_alignBaseline="@id/battery" - android:singleLine="true" - android:text="@string/status_bar_settings_settings_button" - /> - - <ImageView - android:id="@+id/settings_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignBaseline="@id/battery" - android:layout_alignParentRight="true" - android:paddingRight="16dp" - android:src="@drawable/ic_notification_open" - android:baseline="21dp" - /> - - <ImageView - android:id="@+id/notification_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_alignBaseline="@id/battery" - android:paddingRight="16dp" - android:visibility="invisible" - android:src="@drawable/status_bar_veto" - android:baseline="21dp" - /> - </RelativeLayout> + /> <LinearLayout android:id="@+id/content_frame" + android:background="@drawable/notify_panel_notify_bg" android:layout_height="wrap_content" - android:layout_width="408dp" + android:layout_width="447dp" android:orientation="vertical" - android:layout_below="@id/title_area" android:layout_alignParentRight="true" + android:layout_alignParentTop="true" + android:layout_marginTop="352dp" > <ScrollView android:id="@+id/notification_scroller" @@ -189,17 +74,9 @@ android:clickable="true" android:focusable="true" android:descendantFocusability="afterDescendants" - systemui:insetLeft="16dp" > </com.android.systemui.statusbar.tablet.NotificationLinearLayout> </ScrollView> - <ImageView - android:id="@+id/notification_glow" - android:layout_width="match_parent" - android:layout_height="@dimen/status_bar_panel_bottom_offset" - android:layout_marginLeft="16dp" - android:src="@drawable/notify_item_glow_bottom" - /> </LinearLayout> </RelativeLayout> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml new file mode 100644 index 0000000..992995c --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml @@ -0,0 +1,153 @@ +<!-- + Copyright (C) 2006 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" + android:id="@+id/title_area" + android:layout_width="0dp" + android:layout_height="0dp" + android:orientation="vertical" + android:background="@drawable/notify_panel_clock_bg" + > + + <ImageView + android:id="@+id/network_signal" + android:layout_height="32dp" + android:layout_width="32dp" + android:scaleType="centerInside" + android:layout_alignParentLeft="true" + android:layout_alignParentBottom="true" + android:baseline="22dp" + android:layout_marginLeft="32dp" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + /> + + <ImageView + android:id="@+id/network_type" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_alignLeft="@id/network_signal" + android:layout_alignBottom="@id/network_signal" + android:layout_marginRight="8dp" + /> + + <TextView + android:id="@+id/network_text" + style="@style/StatusBarNotificationText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/network_signal" + android:layout_marginRight="8dp" + android:layout_alignBaseline="@id/network_signal" + android:singleLine="true" + android:text="@string/status_bar_settings_settings_button" + /> + + <ImageView + android:id="@+id/battery" + android:layout_height="32dp" + android:layout_width="32dp" + android:scaleType="centerInside" + android:layout_toRightOf="@id/network_text" + android:layout_alignBaseline="@id/network_signal" + android:baseline="22dp" + /> + + <TextView + android:id="@+id/battery_text" + style="@style/StatusBarNotificationText" + android:layout_width="56dp" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/battery" + android:layout_alignBaseline="@id/battery" + android:layout_marginRight="8dp" + android:singleLine="true" + android:text="@string/status_bar_settings_settings_button" + /> + + <ImageView + android:id="@+id/settings_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@id/battery" + android:layout_alignParentRight="true" + android:paddingRight="16dp" + android:src="@drawable/ic_notification_open" + android:baseline="21dp" + /> + + <ImageView + android:id="@+id/notification_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_alignBaseline="@id/battery" + android:paddingRight="16dp" + android:visibility="invisible" + android:src="@drawable/status_bar_veto" + android:baseline="21dp" + /> + + <View + android:id="@+id/title_divider" + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_marginLeft="32dp" + android:layout_alignParentRight="true" + android:layout_alignParentBottom="true" + android:layout_marginBottom="64dip" + android:background="@android:drawable/divider_horizontal_dark" + /> + + <com.android.systemui.statusbar.tablet.HoloClock + android:id="@+id/clock" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_alignParentRight="true" + android:layout_above="@id/title_divider" + android:layout_marginRight="32dip" + android:layout_marginBottom="8dip" + > + <TextView android:id="@+id/time_bg" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="right" + android:singleLine="true" + android:textSize="80sp" + android:textColor="#999999" /> + <TextView android:id="@+id/time_fg" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="right" + android:singleLine="true" + android:textSize="80sp" + android:textColor="#666666" /> + </com.android.systemui.statusbar.tablet.HoloClock> + + <com.android.systemui.statusbar.policy.DateView + android:id="@+id/date" + style="@style/StatusBarNotificationText" + android:layout_height="wrap_content" + android:layout_width="142dp" + android:layout_alignBottom="@id/clock" + android:layout_alignParentLeft="true" + android:gravity="left" + android:layout_marginLeft="32dp" + /> + +</RelativeLayout> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml index e97345b..233cb46 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml @@ -32,7 +32,6 @@ android:layout_alignParentTop="true" android:layout_toRightOf="@id/large_icon" android:layout_toLeftOf="@id/veto" - android:layout_marginLeft="16dp" android:focusable="true" android:clickable="true" /> @@ -40,7 +39,6 @@ <View android:layout_width="match_parent" android:layout_height="1dp" - android:layout_marginLeft="16dp" android:layout_alignParentBottom="true" android:background="@android:drawable/divider_horizontal_dark" /> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml index 8a477e4..1dbd759 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml @@ -22,8 +22,7 @@ android:layout_height="wrap_content" android:orientation="vertical" android:background="@drawable/status_bar_item_background" - android:paddingLeft="16dp" - android:paddingRight="46dp" + android:paddingRight="48dp" > <!-- Airplane mode --> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java index 800f4b4..692d41c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java @@ -50,7 +50,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, View mSettingsButton; View mNotificationButton; View mNotificationScroller; - View mNotificationGlow; ViewGroup mContentFrame; Rect mContentArea = new Rect(); View mSettingsView; @@ -85,7 +84,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, mNotificationButton = (ImageView)findViewById(R.id.notification_button); mNotificationScroller = findViewById(R.id.notification_scroller); - mNotificationGlow = findViewById(R.id.notification_glow); mContentFrame = (ViewGroup)findViewById(R.id.content_frame); } @@ -130,6 +128,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); + mChoreo.setPanelHeight(mContentParent.getHeight()); } @@ -182,7 +181,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, void addSettingsView() { LayoutInflater infl = LayoutInflater.from(getContext()); mSettingsView = infl.inflate(R.layout.status_bar_settings_view, mContentFrame, false); - mContentFrame.addView(mSettingsView, mContentFrame.indexOfChild(mNotificationGlow)); + mContentFrame.addView(mSettingsView); } private class Choreographer implements Animator.AnimatorListener { diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index b7ff64d..2af291d 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -5869,7 +5869,7 @@ public class WindowManagerService extends IWindowManager.Stub final InputWindow inputWindow = windowList.add(); inputWindow.inputChannel = mDragState.mServerChannel; inputWindow.name = "drag"; - inputWindow.layoutParamsFlags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; + inputWindow.layoutParamsFlags = 0; inputWindow.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG; inputWindow.dispatchingTimeoutNanos = DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; inputWindow.visible = true; diff --git a/services/sensorservice/RotationVectorSensor.cpp b/services/sensorservice/RotationVectorSensor.cpp index 418e7f8..3abfc12 100644 --- a/services/sensorservice/RotationVectorSensor.cpp +++ b/services/sensorservice/RotationVectorSensor.cpp @@ -34,9 +34,9 @@ static inline T clamp(T v) { RotationVectorSensor::RotationVectorSensor(sensor_t const* list, size_t count) : mSensorDevice(SensorDevice::getInstance()), - mALowPass(M_SQRT1_2, 5.0f), + mALowPass(M_SQRT1_2, 1.5f), mAX(mALowPass), mAY(mALowPass), mAZ(mALowPass), - mMLowPass(M_SQRT1_2, 2.5f), + mMLowPass(M_SQRT1_2, 1.5f), mMX(mMLowPass), mMY(mMLowPass), mMZ(mMLowPass) { for (size_t i=0 ; i<count ; i++) { diff --git a/services/sensorservice/RotationVectorSensor.h b/services/sensorservice/RotationVectorSensor.h index b7c9512..17699f8 100644 --- a/services/sensorservice/RotationVectorSensor.h +++ b/services/sensorservice/RotationVectorSensor.h @@ -38,9 +38,9 @@ class RotationVectorSensor : public SensorInterface { double mAccTime; double mMagTime; SecondOrderLowPassFilter mALowPass; - BiquadFilter mAX, mAY, mAZ; + CascadedBiquadFilter mAX, mAY, mAZ; SecondOrderLowPassFilter mMLowPass; - BiquadFilter mMX, mMY, mMZ; + CascadedBiquadFilter mMX, mMY, mMZ; public: RotationVectorSensor(sensor_t const* list, size_t count); diff --git a/wifi/java/android/net/wifi/SupplicantStateTracker.java b/wifi/java/android/net/wifi/SupplicantStateTracker.java index f96a5ae..3cde949 100644 --- a/wifi/java/android/net/wifi/SupplicantStateTracker.java +++ b/wifi/java/android/net/wifi/SupplicantStateTracker.java @@ -31,7 +31,7 @@ import android.util.Log; * Tracks the state changes in supplicant and provides functionality * that is based on these state changes: * - detect a failed WPA handshake that loops indefinitely - * - password failure handling + * - authentication failure handling */ class SupplicantStateTracker extends HierarchicalStateMachine { @@ -39,14 +39,14 @@ class SupplicantStateTracker extends HierarchicalStateMachine { private static final boolean DBG = false; private WifiStateMachine mWifiStateMachine; - private int mPasswordFailuresCount = 0; + private int mAuthenticationFailuresCount = 0; /* Indicates authentication failure in supplicant broadcast. * TODO: enhance auth failure reporting to include notification * for all type of failures: EAP, WPS & WPA networks */ private boolean mAuthFailureInSupplicantBroadcast = false; - /* Maximum retries on a password failure notification */ - private static final int MAX_RETRIES_ON_PASSWORD_FAILURE = 2; + /* Maximum retries on a authentication failure notification */ + private static final int MAX_RETRIES_ON_AUTHENTICATION_FAILURE = 2; /* Tracks if networks have been disabled during a connection */ private boolean mNetworksDisabledDuringConnect = false; @@ -155,8 +155,8 @@ class SupplicantStateTracker extends HierarchicalStateMachine { public boolean processMessage(Message message) { if (DBG) Log.d(TAG, getName() + message.toString() + "\n"); switch (message.what) { - case WifiStateMachine.PASSWORD_MAY_BE_INCORRECT_EVENT: - mPasswordFailuresCount++; + case WifiStateMachine.AUTHENTICATION_FAILURE_EVENT: + mAuthenticationFailuresCount++; mAuthFailureInSupplicantBroadcast = true; break; case WifiStateMachine.SUPPLICANT_STATE_CHANGE_EVENT: @@ -206,18 +206,17 @@ class SupplicantStateTracker extends HierarchicalStateMachine { @Override public void enter() { if (DBG) Log.d(TAG, getName() + "\n"); - /* If a disconnect event happens after password key failure + /* If a disconnect event happens after authentication failure * exceeds maximum retries, disable the network */ - Message message = getCurrentMessage(); StateChangeResult stateChangeResult = (StateChangeResult) message.obj; - if (mPasswordFailuresCount >= MAX_RETRIES_ON_PASSWORD_FAILURE) { + if (mAuthenticationFailuresCount >= MAX_RETRIES_ON_AUTHENTICATION_FAILURE) { Log.d(TAG, "Failed to authenticate, disabling network " + stateChangeResult.networkId); handleNetworkConnectionFailure(stateChangeResult.networkId); - mPasswordFailuresCount = 0; + mAuthenticationFailuresCount = 0; } } } @@ -282,8 +281,8 @@ class SupplicantStateTracker extends HierarchicalStateMachine { @Override public void enter() { if (DBG) Log.d(TAG, getName() + "\n"); - /* Reset password failure count */ - mPasswordFailuresCount = 0; + /* Reset authentication failure count */ + mAuthenticationFailuresCount = 0; if (mNetworksDisabledDuringConnect) { WifiConfigStore.enableAllNetworks(); mNetworksDisabledDuringConnect = false; diff --git a/wifi/java/android/net/wifi/WifiMonitor.java b/wifi/java/android/net/wifi/WifiMonitor.java index 090ad3b..ce38261 100644 --- a/wifi/java/android/net/wifi/WifiMonitor.java +++ b/wifi/java/android/net/wifi/WifiMonitor.java @@ -42,7 +42,8 @@ public class WifiMonitor { private static final int LINK_SPEED = 5; private static final int TERMINATING = 6; private static final int DRIVER_STATE = 7; - private static final int UNKNOWN = 8; + private static final int EAP_FAILURE = 8; + private static final int UNKNOWN = 9; /** All events coming from the supplicant start with this prefix */ private static final String eventPrefix = "CTRL-EVENT-"; @@ -110,6 +111,17 @@ public class WifiMonitor { * <code>state</code> is either STARTED or STOPPED */ private static final String driverStateEvent = "DRIVER-STATE"; + /** + * <pre> + * CTRL-EVENT-EAP-FAILURE EAP authentication failed + * </pre> + */ + private static final String eapFailureEvent = "EAP-FAILURE"; + + /** + * This indicates an authentication failure on EAP FAILURE event + */ + private static final String eapAuthFailure = "EAP authentication failed"; /** * Regex pattern for extracting an Ethernet-style MAC address from a string. @@ -176,7 +188,7 @@ public class WifiMonitor { if (!eventStr.startsWith(eventPrefix)) { if (eventStr.startsWith(wpaEventPrefix) && 0 < eventStr.indexOf(passwordKeyMayBeIncorrectEvent)) { - handlePasswordKeyMayBeIncorrect(); + mWifiStateMachine.notifyAuthenticationFailure(); } else if (eventStr.startsWith(wpsOverlapEvent)) { mWifiStateMachine.notifyWpsOverlap(); } @@ -207,16 +219,17 @@ public class WifiMonitor { event = LINK_SPEED; else if (eventName.equals(terminatingEvent)) event = TERMINATING; - else if (eventName.equals(driverStateEvent)) { + else if (eventName.equals(driverStateEvent)) event = DRIVER_STATE; - } + else if (eventName.equals(eapFailureEvent)) + event = EAP_FAILURE; else event = UNKNOWN; String eventData = eventStr; if (event == DRIVER_STATE || event == LINK_SPEED) eventData = eventData.split(" ")[1]; - else if (event == STATE_CHANGE) { + else if (event == STATE_CHANGE || event == EAP_FAILURE) { int ind = eventStr.indexOf(" "); if (ind != -1) { eventData = eventStr.substring(ind + 1); @@ -261,6 +274,10 @@ public class WifiMonitor { // notify and exit mWifiStateMachine.notifySupplicantLost(); break; + } else if (event == EAP_FAILURE) { + if (eventData.startsWith(eapAuthFailure)) { + mWifiStateMachine.notifyAuthenticationFailure(); + } } else { handleEvent(event, eventData); } @@ -284,10 +301,6 @@ public class WifiMonitor { return false; } - private void handlePasswordKeyMayBeIncorrect() { - mWifiStateMachine.notifyPasswordKeyMayBeIncorrect(); - } - private void handleDriverEvent(String state) { if (state == null) { return; diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index df21399..4d0acdd 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -212,8 +212,8 @@ public class WifiStateMachine extends HierarchicalStateMachine { static final int SCAN_RESULTS_EVENT = 38; /* Supplicate state changed */ static final int SUPPLICANT_STATE_CHANGE_EVENT = 39; - /* Password may be incorrect */ - static final int PASSWORD_MAY_BE_INCORRECT_EVENT = 40; + /* Password failure and EAP authentication failure */ + static final int AUTHENTICATION_FAILURE_EVENT = 40; /* WPS overlap detected */ static final int WPS_OVERLAP_EVENT = 41; @@ -1383,11 +1383,12 @@ public class WifiStateMachine extends HierarchicalStateMachine { } /** - * Send the tracker a notification that a user-entered password key - * may be incorrect (i.e., caused authentication to fail). + * Send the tracker a notification that a user provided + * configuration caused authentication failure - this could + * be a password failure or a EAP authentication failure */ - void notifyPasswordKeyMayBeIncorrect() { - sendMessage(PASSWORD_MAY_BE_INCORRECT_EVENT); + void notifyAuthenticationFailure() { + sendMessage(AUTHENTICATION_FAILURE_EVENT); } /** @@ -1515,7 +1516,7 @@ public class WifiStateMachine extends HierarchicalStateMachine { case NETWORK_DISCONNECTION_EVENT: case SCAN_RESULTS_EVENT: case SUPPLICANT_STATE_CHANGE_EVENT: - case PASSWORD_MAY_BE_INCORRECT_EVENT: + case AUTHENTICATION_FAILURE_EVENT: case WPS_OVERLAP_EVENT: case CMD_BLACKLIST_NETWORK: case CMD_CLEAR_BLACKLIST: @@ -2067,7 +2068,7 @@ public class WifiStateMachine extends HierarchicalStateMachine { case SUPPLICANT_STATE_CHANGE_EVENT: case NETWORK_CONNECTION_EVENT: case NETWORK_DISCONNECTION_EVENT: - case PASSWORD_MAY_BE_INCORRECT_EVENT: + case AUTHENTICATION_FAILURE_EVENT: case WPS_OVERLAP_EVENT: case CMD_SET_SCAN_TYPE: case CMD_SET_HIGH_PERF_MODE: @@ -2300,8 +2301,8 @@ public class WifiStateMachine extends HierarchicalStateMachine { if (DBG) Log.d(TAG, getName() + message.toString() + "\n"); StateChangeResult stateChangeResult; switch(message.what) { - case PASSWORD_MAY_BE_INCORRECT_EVENT: - mSupplicantStateTracker.sendMessage(PASSWORD_MAY_BE_INCORRECT_EVENT); + case AUTHENTICATION_FAILURE_EVENT: + mSupplicantStateTracker.sendMessage(AUTHENTICATION_FAILURE_EVENT); break; case WPS_OVERLAP_EVENT: /* We just need to broadcast the error */ |