diff options
-rw-r--r-- | api/current.xml | 98 | ||||
-rwxr-xr-x | core/java/android/content/pm/ConfigurationInfo.java | 30 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 12 | ||||
-rwxr-xr-x | core/java/android/gesture/GestureOverlayView.java | 12 | ||||
-rw-r--r-- | core/java/android/provider/Settings.java | 23 | ||||
-rw-r--r-- | core/java/android/widget/AbsListView.java | 26 | ||||
-rw-r--r-- | core/res/res/values/attrs_manifest.xml | 19 | ||||
-rw-r--r-- | core/res/res/values/public.xml | 1 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/RIL.java | 3 | ||||
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Matrix.java | 132 |
10 files changed, 250 insertions, 106 deletions
diff --git a/api/current.xml b/api/current.xml index 9e29152..c98a5c4 100644 --- a/api/current.xml +++ b/api/current.xml @@ -3518,17 +3518,6 @@ visibility="public" > </field> -<field name="donut_resource_pad30" - type="int" - transient="false" - volatile="false" - value="16843394" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="donut_resource_pad4" type="int" transient="false" @@ -4453,6 +4442,17 @@ visibility="public" > </field> +<field name="glEsVersion" + type="int" + transient="false" + volatile="false" + value="16843394" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="gradientRadius" type="int" transient="false" @@ -35239,6 +35239,17 @@ visibility="public" > </method> +<method name="getGlEsVersion" + return="java.lang.String" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="writeToParcel" return="void" abstract="false" @@ -35264,6 +35275,17 @@ visibility="public" > </field> +<field name="GL_ES_VERSION_UNDEFINED" + type="int" + transient="false" + volatile="false" + value="0" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="INPUT_FEATURE_FIVE_WAY_NAV" type="int" transient="false" @@ -35286,6 +35308,16 @@ visibility="public" > </field> +<field name="reqGlEsVersion" + type="int" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="reqInputFeatures" type="int" transient="false" @@ -107280,6 +107312,50 @@ visibility="public" > </field> +<field name="TTS_DEFAULT_PITCH" + type="java.lang.String" + transient="false" + volatile="false" + value=""tts_default_pitch"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TTS_DEFAULT_RATE" + type="java.lang.String" + transient="false" + volatile="false" + value=""tts_default_rate"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TTS_DEFAULT_SYNTH" + type="java.lang.String" + transient="false" + volatile="false" + value=""tts_default_synth"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TTS_USE_DEFAULTS" + type="java.lang.String" + transient="false" + volatile="false" + value=""tts_use_defaults"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="USB_MASS_STORAGE_ENABLED" type="java.lang.String" transient="false" diff --git a/core/java/android/content/pm/ConfigurationInfo.java b/core/java/android/content/pm/ConfigurationInfo.java index dcc7463..fb7a47f 100755 --- a/core/java/android/content/pm/ConfigurationInfo.java +++ b/core/java/android/content/pm/ConfigurationInfo.java @@ -22,7 +22,7 @@ import android.os.Parcelable; /** * Information you can retrieve about hardware configuration preferences * declared by an application. This corresponds to information collected from the - * AndroidManifest.xml's <uses-configuration> tags. + * AndroidManifest.xml's <uses-configuration> and the <uses-feature>tags. */ public class ConfigurationInfo implements Parcelable { /** @@ -70,6 +70,16 @@ public class ConfigurationInfo implements Parcelable { */ public int reqInputFeatures = 0; + /** + * Default value for {@link #reqGlEsVersion}; + */ + public static final int GL_ES_VERSION_UNDEFINED = 0; + /** + * The GLES version used by an application. The upper order 16 bits represent the + * major version and the lower order 16 bits the minor version. + */ + public int reqGlEsVersion; + public ConfigurationInfo() { } @@ -78,6 +88,7 @@ public class ConfigurationInfo implements Parcelable { reqKeyboardType = orig.reqKeyboardType; reqNavigation = orig.reqNavigation; reqInputFeatures = orig.reqInputFeatures; + reqGlEsVersion = orig.reqGlEsVersion; } public String toString() { @@ -86,7 +97,8 @@ public class ConfigurationInfo implements Parcelable { + ", touchscreen = " + reqTouchScreen + "}" + ", inputMethod = " + reqKeyboardType + "}" + ", navigation = " + reqNavigation + "}" - + ", reqInputFeatures = " + reqInputFeatures + "}"; + + ", reqInputFeatures = " + reqInputFeatures + "}" + + ", reqGlEsVersion = " + reqGlEsVersion + "}"; } public int describeContents() { @@ -98,6 +110,7 @@ public class ConfigurationInfo implements Parcelable { dest.writeInt(reqKeyboardType); dest.writeInt(reqNavigation); dest.writeInt(reqInputFeatures); + dest.writeInt(reqGlEsVersion); } public static final Creator<ConfigurationInfo> CREATOR = @@ -115,5 +128,18 @@ public class ConfigurationInfo implements Parcelable { reqKeyboardType = source.readInt(); reqNavigation = source.readInt(); reqInputFeatures = source.readInt(); + reqGlEsVersion = source.readInt(); + } + + /** + * This method extracts the major and minor version of reqGLEsVersion attribute + * and returns it as a string. Say reqGlEsVersion value of 0x00010002 is returned + * as 1.2 + * @return String representation of the reqGlEsVersion attribute + */ + public String getGlEsVersion() { + int major = ((reqGlEsVersion & 0xffff0000) >> 16); + int minor = reqGlEsVersion & 0x0000ffff; + return String.valueOf(major)+"."+String.valueOf(minor); } } diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index e2c0fe6..ab8559c 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -748,6 +748,18 @@ public class PackageParser { XmlUtils.skipCurrentTag(parser); + } else if (tagName.equals("uses-feature")) { + ConfigurationInfo cPref = new ConfigurationInfo(); + sa = res.obtainAttributes(attrs, + com.android.internal.R.styleable.AndroidManifestUsesFeature); + cPref.reqGlEsVersion = sa.getInt( + com.android.internal.R.styleable.AndroidManifestUsesFeature_glEsVersion, + ConfigurationInfo.GL_ES_VERSION_UNDEFINED); + sa.recycle(); + pkg.configPreferences.add(cPref); + + XmlUtils.skipCurrentTag(parser); + } else if (tagName.equals("uses-sdk")) { if (mSdkVersion > 0) { sa = res.obtainAttributes(attrs, diff --git a/core/java/android/gesture/GestureOverlayView.java b/core/java/android/gesture/GestureOverlayView.java index 6f2c2a7..1251964 100755 --- a/core/java/android/gesture/GestureOverlayView.java +++ b/core/java/android/gesture/GestureOverlayView.java @@ -93,6 +93,7 @@ public class GestureOverlayView extends FrameLayout { private float mTotalLength; private boolean mIsGesturing = false; + private boolean mPreviousWasGesturing = false; private boolean mInterceptEvents = true; private boolean mIsListeningForGestures; @@ -425,6 +426,7 @@ public class GestureOverlayView extends FrameLayout { clear(false); mIsGesturing = false; + mPreviousWasGesturing = false; mStrokeBuffer.clear(); final ArrayList<OnGesturingListener> otherListeners = mOnGesturingListeners; @@ -442,8 +444,10 @@ public class GestureOverlayView extends FrameLayout { @Override public boolean dispatchTouchEvent(MotionEvent event) { if (isEnabled()) { - boolean cancelDispatch = (mIsGesturing || (mCurrentGesture != null && - mCurrentGesture.getStrokesCount() > 0)) && mInterceptEvents; + final boolean cancelDispatch = (mIsGesturing || (mCurrentGesture != null && + mCurrentGesture.getStrokesCount() > 0 && mPreviousWasGesturing)) && + mInterceptEvents; + processEvent(event); if (cancelDispatch) { @@ -451,6 +455,7 @@ public class GestureOverlayView extends FrameLayout { } super.dispatchTouchEvent(event); + return true; } @@ -647,6 +652,7 @@ public class GestureOverlayView extends FrameLayout { } mStrokeBuffer.clear(); + mPreviousWasGesturing = mIsGesturing; mIsGesturing = false; final ArrayList<OnGesturingListener> listeners = mOnGesturingListeners; @@ -688,6 +694,7 @@ public class GestureOverlayView extends FrameLayout { fireOnGesturePerformed(); } + mPreviousWasGesturing = false; mIsFadingOut = false; mFadingHasStarted = false; mPath.rewind(); @@ -707,6 +714,7 @@ public class GestureOverlayView extends FrameLayout { mFadingHasStarted = false; mPath.rewind(); mCurrentGesture = null; + mPreviousWasGesturing = false; setPaintAlpha(255); } diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 7ec3be6..42a5075 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -1924,6 +1924,29 @@ public final class Settings { "enabled_accessibility_services"; /** + * Setting to always use the default text-to-speech settings regardless + * of the application settings. + * 1 = override application settings, + * 0 = use application settings (if specified). + */ + public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; + + /** + * Default text-to-speech engine speech rate. 100 = 1x + */ + public static final String TTS_DEFAULT_RATE = "tts_default_rate"; + + /** + * Default text-to-speech engine pitch. 100 = 1x + */ + public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; + + /** + * Default text-to-speech engine. + */ + public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; + + /** * Whether to notify the user of open networks. * <p> * If not connected and the scan results have an open network, we will diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 14a85f8..f62487f 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -472,7 +472,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private ViewTreeObserver.OnGlobalLayoutListener mGesturesLayoutListener; private boolean mGlobalLayoutListenerAddedGestures; private boolean mInstallGesturesOverlay; - private boolean mPreviousGesturing; private boolean mGlobalLayoutListenerAddedFilter; @@ -737,8 +736,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mGesturesOverlay.removeAllOnGestureListeners(); mGesturesOverlay.setGestureStrokeType(GestureOverlayView.GESTURE_STROKE_TYPE_MULTIPLE); mGesturesOverlay.addOnGesturePerformedListener(new GesturesProcessor()); - - mPreviousGesturing = false; } } @@ -753,25 +750,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override public boolean dispatchTouchEvent(MotionEvent ev) { if (mGestures != GESTURES_NONE) { - if (ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null || - !mFastScroller.isPointInside(ev.getX(), ev.getY())) { - - if (mGesturesPopup.isShowing()) { - mGesturesOverlay.dispatchTouchEvent(ev); - - final boolean isGesturing = mGesturesOverlay.isGesturing(); - - if (!isGesturing) { - mPreviousGesturing = isGesturing; - return super.dispatchTouchEvent(ev); - } else if (!mPreviousGesturing){ - mPreviousGesturing = isGesturing; - final MotionEvent event = MotionEvent.obtain(ev); - event.setAction(MotionEvent.ACTION_CANCEL); - super.dispatchTouchEvent(event); - return true; - } - } + if ((ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null || + !mFastScroller.isPointInside(ev.getX(), ev.getY())) && + mGesturesPopup.isShowing()) { + mGesturesOverlay.dispatchTouchEvent(ev); } } diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 0a2d208..91cd9fd 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -596,7 +596,8 @@ {@link #AndroidManifestUsesPermission uses-permission}, {@link #AndroidManifestUsesConfiguration uses-configuration}, {@link #AndroidManifestApplication application}, - {@link #AndroidManifestInstrumentation instrumentation}. --> + {@link #AndroidManifestInstrumentation instrumentation}, + {@link #AndroidManifestUsesFeature uses-feature}. --> <declare-styleable name="AndroidManifest"> <attr name="versionCode" /> <attr name="versionName" /> @@ -765,6 +766,22 @@ <attr name="reqFiveWayNav" /> </declare-styleable> + <!-- The <code>uses-feature</code> tag specifies + a specific feature used by the application. + For example an application might specify that it requires + specific version of open gl. Multiple such attribute + values can be specified by the application. + + <p>This appears as a child tag of the root + {@link #AndroidManifest manifest} tag. --> + <declare-styleable name="AndroidManifestUsesFeature" parent="AndroidManifest"> + <!-- The GLES driver version number needed by an application. + The higher 16 bits represent the major number and the lower 16 bits + represent the minor number. For example for GL 1.2 referring to + 0x00000102, the actual value should be set as 0x00010002. --> + <attr name="glEsVersion" format="integer"/> + </declare-styleable> + <!-- The <code>uses-sdk</code> tag describes the SDK features that the containing package must be running on to operate correctly. diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index c2c84d6..b29f9ac 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1115,6 +1115,7 @@ <public type="attr" name="fadeEnabled" /> <public type="attr" name="backupAgent" /> <public type="attr" name="allowBackup" /> + <public type="attr" name="glEsVersion" /> <public-padding type="attr" name="donut_resource_pad" end="0x0101029f" /> diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index 0cdeeff..7b486e7 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -1807,7 +1807,6 @@ public final class RIL extends BaseCommands implements CommandsInterface { public void setSmscAddress(String address, Message result) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_SET_SMSC_ADDRESS, result); - rr.mp.writeInt(1); rr.mp.writeString(address); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) @@ -3122,6 +3121,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { case RIL_REQUEST_GET_SMSC_ADDRESS: return "RIL_REQUEST_GET_SMSC_ADDRESS"; case RIL_REQUEST_SET_SMSC_ADDRESS: return "RIL_REQUEST_SET_SMSC_ADDRESS"; case RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE: return "REQUEST_EXIT_EMERGENCY_CALLBACK_MODE"; + case RIL_REQUEST_REPORT_SMS_MEMORY_STATUS: return "RIL_REQUEST_REPORT_SMS_MEMORY_STATUS"; default: return "<unknown request>"; } } @@ -3290,7 +3290,6 @@ public final class RIL extends BaseCommands implements CommandsInterface { sendCDMAFeatureCode(String FeatureCode, Message response) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_CDMA_FLASH, response); - rr.mp.writeInt(1); rr.mp.writeString(FeatureCode); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) diff --git a/tools/layoutlib/bridge/src/android/graphics/Matrix.java b/tools/layoutlib/bridge/src/android/graphics/Matrix.java index 3f9a993..18c0e17 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Matrix.java +++ b/tools/layoutlib/bridge/src/android/graphics/Matrix.java @@ -24,8 +24,8 @@ import java.awt.geom.AffineTransform; */ public class Matrix extends _Original_Matrix { - float mValues[] = new float[9]; - + float mValues[] = new float[9]; + /** * Create an identity matrix */ @@ -40,7 +40,7 @@ public class Matrix extends _Original_Matrix { public Matrix(Matrix src) { set(src); } - + /** * Creates a Matrix object from the float array. The array becomes the internal storage * of the object. @@ -50,14 +50,14 @@ public class Matrix extends _Original_Matrix { assert data.length != 9; mValues = data; } - + @Override public void finalize() throws Throwable { // pass } - + //---------- Custom Methods - + /** * Adds the given transformation to the current Matrix * <p/>This in effect does this = this*matrix @@ -65,17 +65,17 @@ public class Matrix extends _Original_Matrix { */ private void addTransform(float[] matrix) { float[] tmp = new float[9]; - - // first row + + // first row tmp[0] = matrix[0] * mValues[0] + matrix[1] * mValues[3] + matrix[2] * mValues[6]; tmp[1] = matrix[0] * mValues[1] + matrix[1] * mValues[4] + matrix[2] * mValues[7]; tmp[2] = matrix[0] * mValues[2] + matrix[1] * mValues[5] + matrix[2] * mValues[8]; - + // 2nd row tmp[3] = matrix[3] * mValues[0] + matrix[4] * mValues[3] + matrix[5] * mValues[6]; tmp[4] = matrix[3] * mValues[1] + matrix[4] * mValues[4] + matrix[5] * mValues[7]; tmp[5] = matrix[3] * mValues[2] + matrix[4] * mValues[5] + matrix[5] * mValues[8]; - + // 3rd row tmp[6] = matrix[6] * mValues[0] + matrix[7] * mValues[3] + matrix[8] * mValues[6]; tmp[7] = matrix[6] * mValues[1] + matrix[7] * mValues[4] + matrix[8] * mValues[7]; @@ -84,16 +84,16 @@ public class Matrix extends _Original_Matrix { // copy the result over to mValues mValues = tmp; } - + public AffineTransform getTransform() { return new AffineTransform(mValues[0], mValues[1], mValues[2], mValues[3], mValues[4], mValues[5]); } - + public boolean hasPerspective() { return (mValues[6] != 0 || mValues[7] != 0 || mValues[8] != 1); } - + //---------- /** @@ -109,7 +109,7 @@ public class Matrix extends _Original_Matrix { } } } - + return true; } @@ -122,7 +122,7 @@ public class Matrix extends _Original_Matrix { public boolean rectStaysRect() { return (computeTypeMask() & kRectStaysRect_Mask) != 0; } - + /** * (deep) copy the src matrix into this matrix. If src is null, reset this * matrix to the identity matrix. @@ -151,10 +151,10 @@ public class Matrix extends _Original_Matrix { return false; } } - + return true; } - + return false; } @@ -179,7 +179,7 @@ public class Matrix extends _Original_Matrix { mValues[5] = dy; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; } /** @@ -200,7 +200,7 @@ public class Matrix extends _Original_Matrix { mValues[5] = -py; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; // scale addTransform(new float[] { sx, 0, 0, 0, sy, 0, 0, 0, 1 }); @@ -219,7 +219,7 @@ public class Matrix extends _Original_Matrix { mValues[5] = 0; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; } /** @@ -240,13 +240,13 @@ public class Matrix extends _Original_Matrix { mValues[5] = -py; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; // scale double rad = Math.toRadians(degrees); float cos = (float)Math.cos(rad); float sin = (float)Math.sin(rad); - addTransform(new float[] { cos, -sin, 0, sin, cos, 0, 0, 0, 1 }); + addTransform(new float[] { cos, -sin, 0, sin, cos, 0, 0, 0, 1 }); // translate back the pivot addTransform(new float[] { 1, 0, px, 0, 1, py, 0, 0, 1 }); } @@ -268,7 +268,7 @@ public class Matrix extends _Original_Matrix { mValues[5] = 0; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; } /** @@ -289,10 +289,10 @@ public class Matrix extends _Original_Matrix { mValues[5] = -py; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; // scale - addTransform(new float[] { cosValue, -sinValue, 0, sinValue, cosValue, 0, 0, 0, 1 }); + addTransform(new float[] { cosValue, -sinValue, 0, sinValue, cosValue, 0, 0, 0, 1 }); // translate back the pivot addTransform(new float[] { 1, 0, px, 0, 1, py, 0, 0, 1 }); } @@ -308,7 +308,7 @@ public class Matrix extends _Original_Matrix { mValues[5] = 0; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; } /** @@ -329,7 +329,7 @@ public class Matrix extends _Original_Matrix { mValues[5] = -py; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; // scale addTransform(new float[] { 1, kx, 0, ky, 1, 0, 0, 0, 1 }); @@ -348,7 +348,7 @@ public class Matrix extends _Original_Matrix { mValues[5] = 0; mValues[6] = 0; mValues[7] = 0; - mValues[7] = 1; + mValues[8] = 1; } /** @@ -366,10 +366,10 @@ public class Matrix extends _Original_Matrix { tmp.addTransform(a.mValues); set(tmp); } - + return true; } - + @Override public boolean setConcat(_Original_Matrix a, _Original_Matrix b) { throw new UnsupportedOperationException("CALL TO PARENT FORBIDDEN"); @@ -384,7 +384,7 @@ public class Matrix extends _Original_Matrix { // create a matrix that will be multiply by this Matrix m = new Matrix(new float[] { 1, 0, dx, 0, 1, dy, 0, 0, 1 }); m.addTransform(this.mValues); - + System.arraycopy(m.mValues, 0, mValues, 0, 9); return true; } @@ -399,7 +399,7 @@ public class Matrix extends _Original_Matrix { m.setScale(sx, sy, px, py); m.addTransform(mValues); set(m); - + return true; } @@ -413,7 +413,7 @@ public class Matrix extends _Original_Matrix { m.setScale(sx, sy); m.addTransform(mValues); set(m); - + return true; } @@ -427,7 +427,7 @@ public class Matrix extends _Original_Matrix { m.setRotate(degrees, px, py); m.addTransform(mValues); set(m); - + return true; } @@ -441,7 +441,7 @@ public class Matrix extends _Original_Matrix { m.setRotate(degrees); m.addTransform(mValues); set(m); - + return true; } @@ -455,7 +455,7 @@ public class Matrix extends _Original_Matrix { m.setSkew(kx, ky, px, py); m.addTransform(mValues); set(m); - + return true; } @@ -469,7 +469,7 @@ public class Matrix extends _Original_Matrix { m.setSkew(kx, ky); m.addTransform(mValues); set(m); - + return true; } @@ -481,10 +481,10 @@ public class Matrix extends _Original_Matrix { Matrix m = new Matrix(other); other.addTransform(mValues); set(m); - + return true; } - + @Override public boolean preConcat(_Original_Matrix other) { throw new UnsupportedOperationException("CALL TO PARENT FORBIDDEN"); @@ -513,7 +513,7 @@ public class Matrix extends _Original_Matrix { addTransform(new float[] { sx, 0, 0, 0, sy, 0, 0, 0, 1 }); // translate back the pivot addTransform(new float[] { 1, 0, px, 0, 1, py, 0, 0, 1 }); - + return true; } @@ -540,10 +540,10 @@ public class Matrix extends _Original_Matrix { double rad = Math.toRadians(degrees); float cos = (float)Math.cos(rad); float sin = (float)Math.sin(rad); - addTransform(new float[] { cos, -sin, 0, sin, cos, 0, 0, 0, 1 }); + addTransform(new float[] { cos, -sin, 0, sin, cos, 0, 0, 0, 1 }); // translate back the pivot addTransform(new float[] { 1, 0, px, 0, 1, py, 0, 0, 1 }); - + return true; } @@ -557,7 +557,7 @@ public class Matrix extends _Original_Matrix { float cos = (float)Math.cos(rad); float sin = (float)Math.sin(rad); addTransform(new float[] { cos, -sin, 0, sin, cos, 0, 0, 0, 1 }); - + return true; } @@ -574,7 +574,7 @@ public class Matrix extends _Original_Matrix { addTransform(new float[] { 1, kx, 0, ky, 1, 0, 0, 0, 1 }); // translate back the pivot addTransform(new float[] { 1, 0, px, 0, 1, py, 0, 0, 1 }); - + return true; } @@ -585,7 +585,7 @@ public class Matrix extends _Original_Matrix { @Override public boolean postSkew(float kx, float ky) { addTransform(new float[] { 1, kx, 0, ky, 1, 0, 0, 0, 1 }); - + return true; } @@ -595,7 +595,7 @@ public class Matrix extends _Original_Matrix { */ public boolean postConcat(Matrix other) { addTransform(other.mValues); - + return true; } @@ -603,7 +603,7 @@ public class Matrix extends _Original_Matrix { public boolean postConcat(_Original_Matrix other) { throw new UnsupportedOperationException("CALL TO PARENT FORBIDDEN"); } - + /** Controlls how the src rect should align into the dst rect for setRectToRect(). */ @@ -634,7 +634,7 @@ public class Matrix extends _Original_Matrix { */ END (3); - // the native values must match those in SkMatrix.h + // the native values must match those in SkMatrix.h ScaleToFit(int nativeInt) { this.nativeInt = nativeInt; } @@ -655,7 +655,7 @@ public class Matrix extends _Original_Matrix { if (dst == null || src == null) { throw new NullPointerException(); } - + if (src.isEmpty()) { reset(); return false; @@ -689,7 +689,7 @@ public class Matrix extends _Original_Matrix { } else { diff = dst.height() - src.height() * sy; } - + if (stf == ScaleToFit.CENTER) { diff = diff / 2; } @@ -712,12 +712,12 @@ public class Matrix extends _Original_Matrix { mValues[8] = 1; return true; } - + @Override public boolean setRectToRect(RectF src, RectF dst, _Original_Matrix.ScaleToFit stf) { throw new UnsupportedOperationException("CALL TO PARENT FORBIDDEN"); } - + /** * Set the matrix such that the specified src points would map to the * specified dst points. The "points" are represented as an array of floats, @@ -749,7 +749,7 @@ public class Matrix extends _Original_Matrix { public boolean invert(Matrix inverse) { throw new UnsupportedOperationException("STUB NEEDED"); } - + @Override public boolean invert(_Original_Matrix inverse) { throw new UnsupportedOperationException("CALL TO PARENT FORBIDDEN"); @@ -772,7 +772,7 @@ public class Matrix extends _Original_Matrix { checkPointArrays(src, srcIndex, dst, dstIndex, pointCount); throw new UnsupportedOperationException("STUB NEEDED"); } - + /** * Apply this matrix to the array of 2D vectors specified by src, and write * the transformed vectors into the array of vectors specified by dst. The @@ -790,7 +790,7 @@ public class Matrix extends _Original_Matrix { checkPointArrays(src, srcIndex, dst, dstIndex, vectorCount); throw new UnsupportedOperationException("STUB NEEDED"); } - + /** * Apply this matrix to the array of 2D points specified by src, and write * the transformed points into the array of points specified by dst. The @@ -883,7 +883,7 @@ public class Matrix extends _Original_Matrix { public float mapRadius(float radius) { throw new UnsupportedOperationException("STUB NEEDED"); } - + /** Copy 9 values from the matrix into the array. */ @Override @@ -907,7 +907,7 @@ public class Matrix extends _Original_Matrix { } System.arraycopy(values, 0, mValues, 0, mValues.length); } - + @SuppressWarnings("unused") private final static int kIdentity_Mask = 0; private final static int kTranslate_Mask = 0x01; //!< set if the matrix has translation @@ -917,7 +917,7 @@ public class Matrix extends _Original_Matrix { private final static int kRectStaysRect_Mask = 0x10; @SuppressWarnings("unused") private final static int kUnknown_Mask = 0x80; - + @SuppressWarnings("unused") private final static int kAllMasks = kTranslate_Mask | kScale_Mask | @@ -942,43 +942,43 @@ public class Matrix extends _Original_Matrix { if (mValues[6] != 0. || mValues[7] != 0. || mValues[8] != 1.) { mask |= kPerspective_Mask; } - + if (mValues[2] != 0. || mValues[5] != 0.) { mask |= kTranslate_Mask; } - + float m00 = mValues[0]; float m01 = mValues[1]; float m10 = mValues[3]; float m11 = mValues[4]; - + if (m01 != 0. || m10 != 0.) { mask |= kAffine_Mask; } - + if (m00 != 1. || m11 != 1.) { mask |= kScale_Mask; } - + if ((mask & kPerspective_Mask) == 0) { // map non-zero to 1 int im00 = m00 != 0 ? 1 : 0; int im01 = m01 != 0 ? 1 : 0; int im10 = m10 != 0 ? 1 : 0; int im11 = m11 != 0 ? 1 : 0; - + // record if the (p)rimary and (s)econdary diagonals are all 0 or // all non-zero (answer is 0 or 1) int dp0 = (im00 | im11) ^ 1; // true if both are 0 int dp1 = im00 & im11; // true if both are 1 int ds0 = (im01 | im10) ^ 1; // true if both are 0 int ds1 = im01 & im10; // true if both are 1 - + // return 1 if primary is 1 and secondary is 0 or // primary is 0 and secondary is 1 mask |= ((dp0 & ds1) | (dp1 & ds0)) << kRectStaysRect_Shift; } - + return mask; } } |