diff options
Diffstat (limited to 'graphics/java')
6 files changed, 129 insertions, 8 deletions
diff --git a/graphics/java/android/renderscript/RSDriverException.java b/graphics/java/android/renderscript/RSDriverException.java new file mode 100644 index 0000000..61787e6 --- /dev/null +++ b/graphics/java/android/renderscript/RSDriverException.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2010 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. + */ + +package android.renderscript; + + +/** + * Base class for all exceptions thrown by the Android + * Renderscript + * @hide + */ +public class RSDriverException extends RSRuntimeException { + public RSDriverException(String string) { + super(string); + } +} + + + diff --git a/graphics/java/android/renderscript/RSIllegalArgumentException.java b/graphics/java/android/renderscript/RSIllegalArgumentException.java new file mode 100644 index 0000000..8d67a8d --- /dev/null +++ b/graphics/java/android/renderscript/RSIllegalArgumentException.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2010 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. + */ + +package android.renderscript; + + +/** + * Base class for all exceptions thrown by the Android + * Renderscript + * @hide + */ +public class RSIllegalArgumentException extends RSRuntimeException { + public RSIllegalArgumentException(String string) { + super(string); + } +} + + diff --git a/graphics/java/android/renderscript/RSInvalidStateException.java b/graphics/java/android/renderscript/RSInvalidStateException.java new file mode 100644 index 0000000..53b9479 --- /dev/null +++ b/graphics/java/android/renderscript/RSInvalidStateException.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2010 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. + */ + +package android.renderscript; + + +/** + * Base class for all exceptions thrown by the Android + * Renderscript + * @hide + */ +public class RSInvalidStateException extends RSRuntimeException { + public RSInvalidStateException(String string) { + super(string); + } +} + + + diff --git a/graphics/java/android/renderscript/RSRuntimeException.java b/graphics/java/android/renderscript/RSRuntimeException.java new file mode 100644 index 0000000..4c97937 --- /dev/null +++ b/graphics/java/android/renderscript/RSRuntimeException.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2010 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. + */ + +package android.renderscript; + + +/** + * Base class for all exceptions thrown by the Android + * Renderscript + * @hide + */ +public class RSRuntimeException + extends java.lang.RuntimeException { + public RSRuntimeException(String string) { + super(string); + } +} + diff --git a/graphics/java/android/renderscript/RenderScriptGL.java b/graphics/java/android/renderscript/RenderScriptGL.java index 5fe69cd..21cbb9a 100644 --- a/graphics/java/android/renderscript/RenderScriptGL.java +++ b/graphics/java/android/renderscript/RenderScriptGL.java @@ -128,6 +128,9 @@ public class RenderScriptGL extends RenderScript { mSurfaceConfig.mStencilMin, mSurfaceConfig.mStencilPref, mSurfaceConfig.mSamplesMin, mSurfaceConfig.mSamplesPref, mSurfaceConfig.mSamplesQ); + if (mContext == 0) { + throw new RSDriverException("Failed to create RS context."); + } mMessageThread = new MessageThread(this); mMessageThread.start(); Element.initPredefined(this); diff --git a/graphics/java/android/renderscript/Type.java b/graphics/java/android/renderscript/Type.java index caa8b13..9a40d1f 100644 --- a/graphics/java/android/renderscript/Type.java +++ b/graphics/java/android/renderscript/Type.java @@ -33,8 +33,6 @@ public class Type extends BaseObj { int mElementCount; Element mElement; - Class mJavaClass; - public Element getElement() { return mElement; } @@ -124,12 +122,6 @@ public class Type extends BaseObj { calcElementCount(); } - public static Type createFromClass(RenderScript rs, Class c, int size, String scriptName) { - android.util.Log.e("RenderScript", "Calling depricated createFromClass"); - return null; - } - - public static class Builder { RenderScript mRS; Dimension[] mDimensions; |
