diff options
| author | Alex Sakhartchouk <alexst@google.com> | 2010-12-17 11:41:08 -0800 |
|---|---|---|
| committer | Alex Sakhartchouk <alexst@google.com> | 2010-12-17 11:41:08 -0800 |
| commit | e27cdeeecba5b445e307d653d9cb7da007adfac3 (patch) | |
| tree | 2bd196f42ef3d904c610f2b327642391a6724e20 /libs/rs/java | |
| parent | 60e41fa4456ce6bc37a33b1e4b81a56e9411199b (diff) | |
| download | frameworks_base-e27cdeeecba5b445e307d653d9cb7da007adfac3.zip frameworks_base-e27cdeeecba5b445e307d653d9cb7da007adfac3.tar.gz frameworks_base-e27cdeeecba5b445e307d653d9cb7da007adfac3.tar.bz2 | |
API reaview cleanup
Change-Id: Ib1aaf81130ffa6b5e6c60096c27c969e8891db3f
Diffstat (limited to 'libs/rs/java')
6 files changed, 24 insertions, 32 deletions
diff --git a/libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java b/libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java index 6cb50b8..7d99686 100644 --- a/libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java +++ b/libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java @@ -23,6 +23,7 @@ import java.util.Vector; import android.content.res.Resources; import android.renderscript.*; import android.renderscript.Element.Builder; +import android.renderscript.Font.Style; import android.renderscript.ProgramStore.DepthFunc; import android.util.Log; @@ -186,22 +187,20 @@ public class SceneGraphRS { FileA3D model = FileA3D.createFromResource(mRS, mRes, R.raw.robot); FileA3D.IndexEntry entry = model.getIndexEntry(0); - if (entry == null || entry.getClassID() != FileA3D.ClassID.MESH) { + if (entry == null || entry.getEntryType() != FileA3D.EntryType.MESH) { Log.e("rs", "could not load model"); } else { mMesh = (Mesh)entry.getObject(); mScript.set_gTestMesh(mMesh); } - mItalic = Font.create(mRS, mRes, "DroidSerif-Italic.ttf", 8); + mItalic = Font.create(mRS, mRes, "serif", Font.Style.ITALIC, 8); mScript.set_gItalic(mItalic); initTextAllocation(); initTransformHierarchy(); - Log.v("========SceneGraph========", "transform hierarchy initialized"); - mScript.bind_gRootNode(mRootTransform.getField()); mScript.bind_gGroup(mGroup1.mParent.mChildField); diff --git a/libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java b/libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java index 747463a..5451ca1 100644 --- a/libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java +++ b/libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java @@ -148,14 +148,14 @@ public class SimpleModelRS { FileA3D model = FileA3D.createFromResource(mRS, mRes, R.raw.robot); FileA3D.IndexEntry entry = model.getIndexEntry(0); - if (entry == null || entry.getClassID() != FileA3D.ClassID.MESH) { + if (entry == null || entry.getEntryType() != FileA3D.EntryType.MESH) { Log.e("rs", "could not load model"); } else { mMesh = (Mesh)entry.getObject(); mScript.set_gTestMesh(mMesh); } - mItalic = Font.create(mRS, mRes, "DroidSerif-Italic.ttf", 8); + mItalic = Font.create(mRS, mRes, "serif", Font.Style.ITALIC, 8); mScript.set_gItalic(mItalic); initTextAllocation(); diff --git a/libs/rs/java/Samples/src/com/android/samples/RsBenchRS.java b/libs/rs/java/Samples/src/com/android/samples/RsBenchRS.java index ddb05b3..b3e8026 100644 --- a/libs/rs/java/Samples/src/com/android/samples/RsBenchRS.java +++ b/libs/rs/java/Samples/src/com/android/samples/RsBenchRS.java @@ -315,22 +315,15 @@ public class RsBenchRS { private void initFonts() { // Sans font by family name - mFontSans = Font.createFromFamily(mRS, mRes, "sans-serif", - Font.Style.NORMAL, 8); - // Create font by file name - mFontSerif = Font.create(mRS, mRes, "DroidSerif-Regular.ttf", 8); + mFontSans = Font.create(mRS, mRes, "sans-serif", Font.Style.NORMAL, 8); + mFontSerif = Font.create(mRS, mRes, "serif", Font.Style.NORMAL, 8); // Create fonts by family and style - mFontSerifBold = Font.createFromFamily(mRS, mRes, "serif", - Font.Style.BOLD, 8); - mFontSerifItalic = Font.createFromFamily(mRS, mRes, "serif", - Font.Style.ITALIC, 8); - mFontSerifBoldItalic = Font.createFromFamily(mRS, mRes, "serif", - Font.Style.BOLD_ITALIC, 8); - mFontMono = Font.createFromFamily(mRS, mRes, "mono", - Font.Style.NORMAL, 8); - - mTextAlloc = Allocation.createFromString(mRS, "String from allocation", - Allocation.USAGE_SCRIPT); + mFontSerifBold = Font.create(mRS, mRes, "serif", Font.Style.BOLD, 8); + mFontSerifItalic = Font.create(mRS, mRes, "serif", Font.Style.ITALIC, 8); + mFontSerifBoldItalic = Font.create(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); + mFontMono = Font.create(mRS, mRes, "mono", Font.Style.NORMAL, 8); + + mTextAlloc = Allocation.createFromString(mRS, "String from allocation", Allocation.USAGE_SCRIPT); mScript.set_gFontSans(mFontSans); mScript.set_gFontSerif(mFontSerif); @@ -351,7 +344,7 @@ public class RsBenchRS { FileA3D model = FileA3D.createFromResource(mRS, mRes, R.raw.torus); FileA3D.IndexEntry entry = model.getIndexEntry(0); - if (entry == null || entry.getClassID() != FileA3D.ClassID.MESH) { + if (entry == null || entry.getEntryType() != FileA3D.EntryType.MESH) { Log.e("rs", "could not load model"); } else { mTorus = (Mesh)entry.getObject(); diff --git a/libs/rs/java/Samples/src/com/android/samples/RsListRS.java b/libs/rs/java/Samples/src/com/android/samples/RsListRS.java index 223f552..8e2d51f 100644 --- a/libs/rs/java/Samples/src/com/android/samples/RsListRS.java +++ b/libs/rs/java/Samples/src/com/android/samples/RsListRS.java @@ -134,7 +134,7 @@ public class RsListRS { mScript.bind_gList(mListAllocs); - mItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); + mItalic = Font.create(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); mScript.set_gItalic(mItalic); mRS.bindRootScript(mScript); diff --git a/libs/rs/java/Samples/src/com/android/samples/RsRenderStatesRS.java b/libs/rs/java/Samples/src/com/android/samples/RsRenderStatesRS.java index 75e8d99..636a486 100644 --- a/libs/rs/java/Samples/src/com/android/samples/RsRenderStatesRS.java +++ b/libs/rs/java/Samples/src/com/android/samples/RsRenderStatesRS.java @@ -23,6 +23,7 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.renderscript.*; import android.renderscript.Allocation.CubemapLayout; +import android.renderscript.Font.Style; import android.renderscript.Program.TextureType; import android.renderscript.ProgramStore.DepthFunc; import android.renderscript.Sampler.Value; @@ -304,14 +305,13 @@ public class RsRenderStatesRS { private void initFonts() { // Sans font by family name - mFontSans = Font.createFromFamily(mRS, mRes, "sans-serif", Font.Style.NORMAL, 8); - // Create font by file name - mFontSerif = Font.create(mRS, mRes, "DroidSerif-Regular.ttf", 8); + mFontSans = Font.create(mRS, mRes, "sans-serif", Font.Style.NORMAL, 8); + mFontSerif = Font.create(mRS, mRes, "serif", Font.Style.NORMAL, 8); // Create fonts by family and style - mFontSerifBold = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD, 8); - mFontSerifItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.ITALIC, 8); - mFontSerifBoldItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); - mFontMono = Font.createFromFamily(mRS, mRes, "mono", Font.Style.NORMAL, 8); + mFontSerifBold = Font.create(mRS, mRes, "serif", Font.Style.BOLD, 8); + mFontSerifItalic = Font.create(mRS, mRes, "serif", Font.Style.ITALIC, 8); + mFontSerifBoldItalic = Font.create(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8); + mFontMono = Font.create(mRS, mRes, "mono", Font.Style.NORMAL, 8); mTextAlloc = Allocation.createFromString(mRS, "String from allocation", Allocation.USAGE_SCRIPT); @@ -330,7 +330,7 @@ public class RsRenderStatesRS { FileA3D model = FileA3D.createFromResource(mRS, mRes, R.raw.torus); FileA3D.IndexEntry entry = model.getIndexEntry(0); - if (entry == null || entry.getClassID() != FileA3D.ClassID.MESH) { + if (entry == null || entry.getEntryType() != FileA3D.EntryType.MESH) { Log.e("rs", "could not load model"); } else { mTorus = (Mesh)entry.getObject(); diff --git a/libs/rs/java/tests/src/com/android/rs/test/RSTestCore.java b/libs/rs/java/tests/src/com/android/rs/test/RSTestCore.java index 265e1d6..a50321e 100644 --- a/libs/rs/java/tests/src/com/android/rs/test/RSTestCore.java +++ b/libs/rs/java/tests/src/com/android/rs/test/RSTestCore.java @@ -94,7 +94,7 @@ public class RSTestCore { mScript.bind_gList(mListAllocs); - mFont = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD, 8); + mFont = Font.create(mRS, mRes, "serif", Font.Style.BOLD, 8); mScript.set_gFont(mFont); mRS.bindRootScript(mScript); |
