Merge "Resolve memory leak in TextServicesManagerService" into ics-mr1
diff --git a/Android.mk b/Android.mk
index 7209206..586eb4a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -396,8 +396,6 @@
# (see development/build/sdk.atree)
web_docs_sample_code_flags := \
-hdf android.hasSamples 1 \
- -samplecode $(sample_dir)/AccessibilityService \
- resources/samples/AccessibilityService "Accessibility Service" \
-samplecode $(sample_dir)/AccelerometerPlay \
resources/samples/AccelerometerPlay "Accelerometer Play" \
-samplecode $(sample_dir)/ActionBarCompat \
diff --git a/api/current.txt b/api/current.txt
index 8654f67..c4dd900 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -9366,6 +9366,7 @@
method public java.util.List<android.hardware.Camera.Size> getSupportedVideoSizes();
method public java.util.List<java.lang.String> getSupportedWhiteBalance();
method public float getVerticalViewAngle();
+ method public boolean getVideoStabilization();
method public java.lang.String getWhiteBalance();
method public int getZoom();
method public java.util.List<java.lang.Integer> getZoomRatios();
@@ -9373,6 +9374,7 @@
method public boolean isAutoWhiteBalanceLockSupported();
method public boolean isSmoothZoomSupported();
method public boolean isVideoSnapshotSupported();
+ method public boolean isVideoStabilizationSupported();
method public boolean isZoomSupported();
method public void remove(java.lang.String);
method public void removeGpsData();
@@ -9404,6 +9406,7 @@
method public void setRecordingHint(boolean);
method public void setRotation(int);
method public void setSceneMode(java.lang.String);
+ method public void setVideoStabilization(boolean);
method public void setWhiteBalance(java.lang.String);
method public void setZoom(int);
method public void unflatten(java.lang.String);
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index 58cd27c..85aec4c 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -1025,6 +1025,8 @@
}
void startPendingDeferredFragments() {
+ if (mActive == null) return;
+
for (int i=0; i<mActive.size(); i++) {
Fragment f = mActive.get(i);
if (f != null) {
diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java
index aef0c6f..1b8a4f5 100644
--- a/core/java/android/app/LoaderManager.java
+++ b/core/java/android/app/LoaderManager.java
@@ -419,7 +419,7 @@
mInactiveLoaders.remove(mId);
}
- if (!hasRunningLoaders() && mActivity != null) {
+ if (mActivity != null && !hasRunningLoaders()) {
mActivity.mFragments.startPendingDeferredFragments();
}
}
@@ -681,6 +681,9 @@
mInactiveLoaders.removeAt(idx);
info.destroy();
}
+ if (mActivity != null && !hasRunningLoaders()) {
+ mActivity.mFragments.startPendingDeferredFragments();
+ }
}
/**
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index caad6fd..93a1b6c 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -3256,7 +3256,6 @@
* disable video stabilization.
* @see #isVideoStabilizationSupported()
* @see #getVideoStabilization()
- * @hide
*/
public void setVideoStabilization(boolean toggle) {
set(KEY_VIDEO_STABILIZATION, toggle ? TRUE : FALSE);
@@ -3269,7 +3268,6 @@
* @return true if video stabilization is enabled
* @see #isVideoStabilizationSupported()
* @see #setVideoStabilization(boolean)
- * @hide
*/
public boolean getVideoStabilization() {
String str = get(KEY_VIDEO_STABILIZATION);
@@ -3283,7 +3281,6 @@
* @return true if video stabilization is supported
* @see #setVideoStabilization(boolean)
* @see #getVideoStabilization()
- * @hide
*/
public boolean isVideoStabilizationSupported() {
String str = get(KEY_VIDEO_STABILIZATION_SUPPORTED);
diff --git a/core/java/android/nfc/NfcFragment.java b/core/java/android/nfc/NfcFragment.java
index 17278dc..d6b15ad 100644
--- a/core/java/android/nfc/NfcFragment.java
+++ b/core/java/android/nfc/NfcFragment.java
@@ -48,7 +48,10 @@
FragmentManager manager = activity.getFragmentManager();
Fragment fragment = manager.findFragmentByTag(FRAGMENT_TAG);
if (fragment != null) {
- manager.beginTransaction().remove(fragment).commit();
+ // We allow state loss at this point, because the state is only
+ // lost when activity is being paused *AND* subsequently destroyed.
+ // In that case, the app will setup foreground dispatch again anyway.
+ manager.beginTransaction().remove(fragment).commitAllowingStateLoss();
}
}
diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java
index 79995d0..0e6d07d 100755
--- a/core/java/android/provider/Telephony.java
+++ b/core/java/android/provider/Telephony.java
@@ -1271,9 +1271,6 @@
Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(),
uri, ID_PROJECTION, null, null, null);
- if (DEBUG) {
- Log.v(TAG, "getOrCreateThreadId cursor cnt: " + cursor.getCount());
- }
if (cursor != null) {
try {
if (cursor.moveToFirst()) {
diff --git a/core/java/android/webkit/HTML5VideoFullScreen.java b/core/java/android/webkit/HTML5VideoFullScreen.java
index 0ea27a0..f29aff2 100644
--- a/core/java/android/webkit/HTML5VideoFullScreen.java
+++ b/core/java/android/webkit/HTML5VideoFullScreen.java
@@ -150,7 +150,9 @@
private void prepareForFullScreen() {
// So in full screen, we reset the MediaPlayer
mPlayer.reset();
- setMediaController(new MediaController(mProxy.getContext()));
+ MediaController mc = new MediaController(mProxy.getContext());
+ mc.setSystemUiVisibility(mLayout.getSystemUiVisibility());
+ setMediaController(mc);
mPlayer.setScreenOnWhilePlaying(true);
prepareDataAndDisplayMode(mProxy);
}
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 9ef1aa1..7f7a3a7 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -3361,6 +3361,7 @@
final ListAdapter adapter = mAdapter;
int closetChildIndex = -1;
+ int closestChildTop = 0;
if (adapter != null && gainFocus && previouslyFocusedRect != null) {
previouslyFocusedRect.offset(mScrollX, mScrollY);
@@ -3392,12 +3393,13 @@
if (distance < minDistance) {
minDistance = distance;
closetChildIndex = i;
+ closestChildTop = other.getTop();
}
}
}
if (closetChildIndex >= 0) {
- setSelection(closetChildIndex + mFirstPosition);
+ setSelectionFromTop(closetChildIndex + mFirstPosition, closestChildTop);
} else {
requestLayout();
}
diff --git a/docs/html/resources/resources-data.js b/docs/html/resources/resources-data.js
index 164bd16..237e18c 100644
--- a/docs/html/resources/resources-data.js
+++ b/docs/html/resources/resources-data.js
@@ -398,16 +398,6 @@
}
},
{
- tags: ['sample', 'accessibility'],
- path: 'samples/AccessibilityService/index.html',
- title: {
- en: 'Accessibility Service'
- },
- description: {
- en: 'Illustrates an accessibility service that provides custom feedback for the Clock application which comes by default with Android devices'
- }
- },
- {
tags: ['sample', 'new', 'ui', 'compatibility', 'newfeature'],
path: 'samples/ActionBarCompat/index.html',
title: {
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp
index 948ecf9..5291a1f 100644
--- a/libs/rs/rsContext.cpp
+++ b/libs/rs/rsContext.cpp
@@ -359,6 +359,7 @@
mTargetSdkVersion = 14;
mDPI = 96;
mIsContextLite = false;
+ memset(&watchdog, 0, sizeof(watchdog));
}
Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc) {
diff --git a/libs/rs/scriptc/rs_graphics.rsh b/libs/rs/scriptc/rs_graphics.rsh
index 80267c7..2581953 100644
--- a/libs/rs/scriptc/rs_graphics.rsh
+++ b/libs/rs/scriptc/rs_graphics.rsh
@@ -22,56 +22,6 @@
*/
#ifndef __RS_GRAPHICS_RSH__
#define __RS_GRAPHICS_RSH__
-
-// These are API 15 once it get official
-typedef enum {
- RS_DEPTH_FUNC_ALWAYS,
- RS_DEPTH_FUNC_LESS,
- RS_DEPTH_FUNC_LEQUAL,
- RS_DEPTH_FUNC_GREATER,
- RS_DEPTH_FUNC_GEQUAL,
- RS_DEPTH_FUNC_EQUAL,
- RS_DEPTH_FUNC_NOTEQUAL
-} rs_depth_func;
-
-typedef enum {
- RS_BLEND_SRC_ZERO, // 0
- RS_BLEND_SRC_ONE, // 1
- RS_BLEND_SRC_DST_COLOR, // 2
- RS_BLEND_SRC_ONE_MINUS_DST_COLOR, // 3
- RS_BLEND_SRC_SRC_ALPHA, // 4
- RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA, // 5
- RS_BLEND_SRC_DST_ALPHA, // 6
- RS_BLEND_SRC_ONE_MINUS_DST_ALPHA, // 7
- RS_BLEND_SRC_SRC_ALPHA_SATURATE // 8
-} rs_blend_src_func;
-
-typedef enum {
- RS_BLEND_DST_ZERO, // 0
- RS_BLEND_DST_ONE, // 1
- RS_BLEND_DST_SRC_COLOR, // 2
- RS_BLEND_DST_ONE_MINUS_SRC_COLOR, // 3
- RS_BLEND_DST_SRC_ALPHA, // 4
- RS_BLEND_DST_ONE_MINUS_SRC_ALPHA, // 5
- RS_BLEND_DST_DST_ALPHA, // 6
- RS_BLEND_DST_ONE_MINUS_DST_ALPHA // 7
-} rs_blend_dst_func;
-
-typedef enum {
- RS_CULL_BACK,
- RS_CULL_FRONT,
- RS_CULL_NONE
-} rs_cull_mode;
-
-typedef enum {
- RS_SAMPLER_NEAREST,
- RS_SAMPLER_LINEAR,
- RS_SAMPLER_LINEAR_MIP_LINEAR,
- RS_SAMPLER_WRAP,
- RS_SAMPLER_CLAMP,
- RS_SAMPLER_LINEAR_MIP_NEAREST,
-} rs_sampler_value;
-
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
/**
* Set the color target used for all subsequent rendering calls
@@ -132,88 +82,6 @@
extern void __attribute__((overloadable))
rsgBindProgramStore(rs_program_store ps);
-
-/**
- * @hide
- * Get program store depth function
- *
- * @param ps
- */
-extern rs_depth_func __attribute__((overloadable))
- rsgProgramStoreGetDepthFunc(rs_program_store ps);
-
-/**
- * @hide
- * Get program store depth mask
- *
- * @param ps
- */
-extern bool __attribute__((overloadable))
- rsgProgramStoreGetDepthMask(rs_program_store ps);
-/**
- * @hide
- * Get program store red component color mask
- *
- * @param ps
- */
-extern bool __attribute__((overloadable))
- rsgProgramStoreGetColorMaskR(rs_program_store ps);
-
-/**
- * @hide
- * Get program store green component color mask
- *
- * @param ps
- */
-extern bool __attribute__((overloadable))
- rsgProgramStoreGetColorMaskG(rs_program_store ps);
-
-/**
- * @hide
- * Get program store blur component color mask
- *
- * @param ps
- */
-extern bool __attribute__((overloadable))
- rsgProgramStoreGetColorMaskB(rs_program_store ps);
-
-/**
- * @hide
- * Get program store alpha component color mask
- *
- * @param ps
- */
-extern bool __attribute__((overloadable))
- rsgProgramStoreGetColorMaskA(rs_program_store ps);
-
-/**
- * @hide
- * Get program store blend source function
- *
- * @param ps
- */
-extern rs_blend_src_func __attribute__((overloadable))
- rsgProgramStoreGetBlendSrcFunc(rs_program_store ps);
-
-/**
- * @hide
- * Get program store blend destination function
- *
- * @param ps
- */
-extern rs_blend_dst_func __attribute__((overloadable))
- rsgProgramStoreGetBlendDstFunc(rs_program_store ps);
-
-/**
- * @hide
- * Get program store dither state
- *
- * @param ps
- */
-extern bool __attribute__((overloadable))
- rsgProgramStoreGetDitherEnabled(rs_program_store ps);
-
-
/**
* Bind a new ProgramVertex to the rendering context.
*
@@ -231,24 +99,6 @@
rsgBindProgramRaster(rs_program_raster pr);
/**
- * @hide
- * Get program raster point sprite state
- *
- * @param pr
- */
-extern bool __attribute__((overloadable))
- rsgProgramRasterGetPointSpriteEnabled(rs_program_raster pr);
-
-/**
- * @hide
- * Get program raster cull mode
- *
- * @param pr
- */
-extern rs_cull_mode __attribute__((overloadable))
- rsgProgramRasterGetCullMode(rs_program_raster pr);
-
-/**
* Bind a new Sampler object to a ProgramFragment. The sampler will
* operate on the texture bound at the matching slot.
*
@@ -258,51 +108,6 @@
rsgBindSampler(rs_program_fragment, uint slot, rs_sampler);
/**
- * @hide
- * Get sampler minification value
- *
- * @param pr
- */
-extern rs_sampler_value __attribute__((overloadable))
- rsgSamplerGetMinification(rs_sampler s);
-
-/**
- * @hide
- * Get sampler magnification value
- *
- * @param pr
- */
-extern rs_sampler_value __attribute__((overloadable))
- rsgSamplerGetMagnification(rs_sampler s);
-
-/**
- * @hide
- * Get sampler wrap S value
- *
- * @param pr
- */
-extern rs_sampler_value __attribute__((overloadable))
- rsgSamplerGetWrapS(rs_sampler s);
-
-/**
- * @hide
- * Get sampler wrap T value
- *
- * @param pr
- */
-extern rs_sampler_value __attribute__((overloadable))
- rsgSamplerGetWrapT(rs_sampler s);
-
-/**
- * @hide
- * Get sampler anisotropy
- *
- * @param pr
- */
-extern float __attribute__((overloadable))
- rsgSamplerGetAnisotropy(rs_sampler s);
-
-/**
* Bind a new Allocation object to a ProgramFragment. The
* Allocation must be a valid texture for the Program. The sampling
* of the texture will be controled by the Sampler bound at the
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 25a3705..2f32bd8 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1635,8 +1635,10 @@
// "silent mode", but which one?
newRingerMode = vibeInSilent ? RINGER_MODE_VIBRATE : RINGER_MODE_SILENT;
}
- if (uiIndex == 0 || (mPrevVolDirection == AudioManager.ADJUST_LOWER &&
- mVoiceCapable && streamType == AudioSystem.STREAM_RING)) {
+ if (uiIndex == 0 ||
+ (!vibeInSilent &&
+ mPrevVolDirection == AudioManager.ADJUST_LOWER &&
+ mVoiceCapable && streamType == AudioSystem.STREAM_RING)) {
adjustVolumeIndex = false;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index 6549610..c259c28 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -462,16 +462,20 @@
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
- mBackgroundView.setAlpha(0f);
+ mBackgroundView.setFastAlpha(0f);
mBackgroundView.setVisibility(View.VISIBLE);
- mScreenshotContainerView.setAlpha(0f);
- mScreenshotContainerView.setTranslationX(0f);
- mScreenshotContainerView.setTranslationY(0f);
- mScreenshotContainerView.setScaleX(SCREENSHOT_SCALE + mBgPaddingScale);
- mScreenshotContainerView.setScaleY(SCREENSHOT_SCALE + mBgPaddingScale);
+ mBackgroundView.fastInvalidate();
+ mScreenshotContainerView.setFastAlpha(0f);
+ mScreenshotContainerView.setFastTranslationX(0f);
+ mScreenshotContainerView.setFastTranslationY(0f);
+ mScreenshotContainerView.setFastScaleX(SCREENSHOT_SCALE + mBgPaddingScale);
+ mScreenshotContainerView.setFastScaleY(SCREENSHOT_SCALE + mBgPaddingScale);
mScreenshotContainerView.setVisibility(View.VISIBLE);
- mScreenshotFlash.setAlpha(0f);
+ mScreenshotContainerView.fastInvalidate();
+ mScreenshotFlash.setFastAlpha(0f);
mScreenshotFlash.setVisibility(View.VISIBLE);
+ mScreenshotFlash.fastInvalidate();
+ mScreenshotLayout.invalidate();
}
@Override
public void onAnimationEnd(android.animation.Animator animation) {
@@ -485,11 +489,15 @@
float scaleT = (SCREENSHOT_SCALE + mBgPaddingScale)
- (float) scaleInterpolator.getInterpolation(t)
* (SCREENSHOT_SCALE - SCREENSHOT_DROP_IN_MIN_SCALE);
- mBackgroundView.setAlpha(scaleInterpolator.getInterpolation(t) * BACKGROUND_ALPHA);
- mScreenshotContainerView.setAlpha(t);
- mScreenshotContainerView.setScaleX(scaleT);
- mScreenshotContainerView.setScaleY(scaleT);
- mScreenshotFlash.setAlpha(flashAlphaInterpolator.getInterpolation(t));
+ mBackgroundView.setFastAlpha(scaleInterpolator.getInterpolation(t) * BACKGROUND_ALPHA);
+ mBackgroundView.fastInvalidate();
+ mScreenshotContainerView.setFastAlpha(t);
+ mScreenshotContainerView.setFastScaleX(scaleT);
+ mScreenshotContainerView.setFastScaleY(scaleT);
+ mScreenshotContainerView.fastInvalidate();
+ mScreenshotFlash.setFastAlpha(flashAlphaInterpolator.getInterpolation(t));
+ mScreenshotFlash.fastInvalidate();
+ mScreenshotLayout.invalidate();
}
});
return anim;
@@ -517,10 +525,13 @@
float scaleT = (SCREENSHOT_DROP_IN_MIN_SCALE + mBgPaddingScale)
- (float) t * (SCREENSHOT_DROP_IN_MIN_SCALE
- SCREENSHOT_FAST_DROP_OUT_MIN_SCALE);
- mBackgroundView.setAlpha((1f - t) * BACKGROUND_ALPHA);
- mScreenshotContainerView.setAlpha(1f - t);
- mScreenshotContainerView.setScaleX(scaleT);
- mScreenshotContainerView.setScaleY(scaleT);
+ mBackgroundView.setFastAlpha((1f - t) * BACKGROUND_ALPHA);
+ mBackgroundView.fastInvalidate();
+ mScreenshotContainerView.setFastAlpha(1f - t);
+ mScreenshotContainerView.setFastScaleX(scaleT);
+ mScreenshotContainerView.setFastScaleY(scaleT);
+ mScreenshotContainerView.fastInvalidate();
+ mScreenshotLayout.invalidate();
}
});
} else {
@@ -555,12 +566,15 @@
float scaleT = (SCREENSHOT_DROP_IN_MIN_SCALE + mBgPaddingScale)
- (float) scaleInterpolator.getInterpolation(t)
* (SCREENSHOT_DROP_IN_MIN_SCALE - SCREENSHOT_DROP_OUT_MIN_SCALE);
- mBackgroundView.setAlpha((1f - t) * BACKGROUND_ALPHA);
- mScreenshotContainerView.setAlpha(1f - scaleInterpolator.getInterpolation(t));
- mScreenshotContainerView.setScaleX(scaleT);
- mScreenshotContainerView.setScaleY(scaleT);
- mScreenshotContainerView.setTranslationX(t * finalPos.x);
- mScreenshotContainerView.setTranslationY(t * finalPos.y);
+ mBackgroundView.setFastAlpha((1f - t) * BACKGROUND_ALPHA);
+ mBackgroundView.fastInvalidate();
+ mScreenshotContainerView.setFastAlpha(1f - scaleInterpolator.getInterpolation(t));
+ mScreenshotContainerView.setFastScaleX(scaleT);
+ mScreenshotContainerView.setFastScaleY(scaleT);
+ mScreenshotContainerView.setFastTranslationX(t * finalPos.x);
+ mScreenshotContainerView.setFastTranslationY(t * finalPos.y);
+ mScreenshotContainerView.fastInvalidate();
+ mScreenshotLayout.invalidate();
}
});
}
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java
index 4466e59..c038478 100644
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java
@@ -64,9 +64,6 @@
unitTests = new ArrayList<UnitTest>();
- unitTests.add(new UT_sampler(this, mRes, mCtx));
- unitTests.add(new UT_program_store(this, mRes, mCtx));
- unitTests.add(new UT_program_raster(this, mRes, mCtx));
unitTests.add(new UT_primitives(this, mRes, mCtx));
unitTests.add(new UT_vector(this, mRes, mCtx));
unitTests.add(new UT_rsdebug(this, mRes, mCtx));
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_program_raster.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_program_raster.java
deleted file mode 100644
index 2bfb6b1..0000000
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_program_raster.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.rs.test;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.renderscript.*;
-import android.renderscript.ProgramRaster;
-import android.renderscript.ProgramRaster.CullMode;
-
-public class UT_program_raster extends UnitTest {
- private Resources mRes;
-
- ProgramRaster pointSpriteEnabled;
- ProgramRaster cullMode;
-
- protected UT_program_raster(RSTestCore rstc, Resources res, Context ctx) {
- super(rstc, "ProgramRaster", ctx);
- mRes = res;
- }
-
- private ProgramRaster.Builder getDefaultBuilder(RenderScript RS) {
- ProgramRaster.Builder b = new ProgramRaster.Builder(RS);
- b.setCullMode(CullMode.BACK);
- b.setPointSpriteEnabled(false);
- return b;
- }
-
- private void initializeGlobals(RenderScript RS, ScriptC_program_raster s) {
- ProgramRaster.Builder b = getDefaultBuilder(RS);
- pointSpriteEnabled = b.setPointSpriteEnabled(true).create();
- b = getDefaultBuilder(RS);
- cullMode = b.setCullMode(CullMode.FRONT).create();
-
- s.set_pointSpriteEnabled(pointSpriteEnabled);
- s.set_cullMode(cullMode);
- }
-
- private void testScriptSide(RenderScript pRS) {
- ScriptC_program_raster s = new ScriptC_program_raster(pRS, mRes, R.raw.program_raster);
- pRS.setMessageHandler(mRsMessage);
- initializeGlobals(pRS, s);
- s.invoke_program_raster_test();
- pRS.finish();
- waitForMessage();
- }
-
- private void testJavaSide(RenderScript RS) {
- _RS_ASSERT("pointSpriteEnabled.getPointSpriteEnabled() == true",
- pointSpriteEnabled.getPointSpriteEnabled() == true);
- _RS_ASSERT("pointSpriteEnabled.getCullMode() == ProgramRaster.CullMode.BACK",
- pointSpriteEnabled.getCullMode() == ProgramRaster.CullMode.BACK);
-
- _RS_ASSERT("cullMode.getPointSpriteEnabled() == false",
- cullMode.getPointSpriteEnabled() == false);
- _RS_ASSERT("cullMode.getCullMode() == ProgramRaster.CullMode.FRONT",
- cullMode.getCullMode() == ProgramRaster.CullMode.FRONT);
-
- updateUI();
- }
-
- public void run() {
- RenderScript pRS = RenderScript.create(mCtx);
- testScriptSide(pRS);
- testJavaSide(pRS);
- pRS.destroy();
- }
-}
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_program_store.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_program_store.java
deleted file mode 100644
index 72a401d..0000000
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_program_store.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.rs.test;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.renderscript.*;
-import android.renderscript.ProgramStore.BlendDstFunc;
-import android.renderscript.ProgramStore.BlendSrcFunc;
-import android.renderscript.ProgramStore.Builder;
-import android.renderscript.ProgramStore.DepthFunc;
-
-public class UT_program_store extends UnitTest {
- private Resources mRes;
-
- ProgramStore ditherEnable;
- ProgramStore colorRWriteEnable;
- ProgramStore colorGWriteEnable;
- ProgramStore colorBWriteEnable;
- ProgramStore colorAWriteEnable;
- ProgramStore blendSrc;
- ProgramStore blendDst;
- ProgramStore depthWriteEnable;
- ProgramStore depthFunc;
-
- protected UT_program_store(RSTestCore rstc, Resources res, Context ctx) {
- super(rstc, "ProgramStore", ctx);
- mRes = res;
- }
-
- private ProgramStore.Builder getDefaultBuilder(RenderScript RS) {
- ProgramStore.Builder b = new ProgramStore.Builder(RS);
- b.setBlendFunc(ProgramStore.BlendSrcFunc.ZERO, ProgramStore.BlendDstFunc.ZERO);
- b.setColorMaskEnabled(false, false, false, false);
- b.setDepthFunc(ProgramStore.DepthFunc.ALWAYS);
- b.setDepthMaskEnabled(false);
- b.setDitherEnabled(false);
- return b;
- }
-
- private void initializeGlobals(RenderScript RS, ScriptC_program_store s) {
- ProgramStore.Builder b = getDefaultBuilder(RS);
- ditherEnable = b.setDitherEnabled(true).create();
-
- b = getDefaultBuilder(RS);
- colorRWriteEnable = b.setColorMaskEnabled(true, false, false, false).create();
-
- b = getDefaultBuilder(RS);
- colorGWriteEnable = b.setColorMaskEnabled(false, true, false, false).create();
-
- b = getDefaultBuilder(RS);
- colorBWriteEnable = b.setColorMaskEnabled(false, false, true, false).create();
-
- b = getDefaultBuilder(RS);
- colorAWriteEnable = b.setColorMaskEnabled(false, false, false, true).create();
-
- b = getDefaultBuilder(RS);
- blendSrc = b.setBlendFunc(ProgramStore.BlendSrcFunc.DST_COLOR,
- ProgramStore.BlendDstFunc.ZERO).create();
-
- b = getDefaultBuilder(RS);
- blendDst = b.setBlendFunc(ProgramStore.BlendSrcFunc.ZERO,
- ProgramStore.BlendDstFunc.DST_ALPHA).create();
-
- b = getDefaultBuilder(RS);
- depthWriteEnable = b.setDepthMaskEnabled(true).create();
-
- b = getDefaultBuilder(RS);
- depthFunc = b.setDepthFunc(ProgramStore.DepthFunc.GREATER).create();
-
- s.set_ditherEnable(ditherEnable);
- s.set_colorRWriteEnable(colorRWriteEnable);
- s.set_colorGWriteEnable(colorGWriteEnable);
- s.set_colorBWriteEnable(colorBWriteEnable);
- s.set_colorAWriteEnable(colorAWriteEnable);
- s.set_blendSrc(blendSrc);
- s.set_blendDst(blendDst);
- s.set_depthWriteEnable(depthWriteEnable);
- s.set_depthFunc(depthFunc);
- }
-
- private void testScriptSide(RenderScript pRS) {
- ScriptC_program_store s = new ScriptC_program_store(pRS, mRes, R.raw.program_store);
- pRS.setMessageHandler(mRsMessage);
- initializeGlobals(pRS, s);
- s.invoke_program_store_test();
- pRS.finish();
- waitForMessage();
- }
-
- void checkObject(ProgramStore ps,
- boolean depthMask,
- DepthFunc df,
- BlendSrcFunc bsf,
- BlendDstFunc bdf,
- boolean R,
- boolean G,
- boolean B,
- boolean A,
- boolean dither) {
- _RS_ASSERT("ps.getDepthMaskEnabled() == depthMask", ps.getDepthMaskEnabled() == depthMask);
- _RS_ASSERT("ps.getDepthFunc() == df", ps.getDepthFunc() == df);
- _RS_ASSERT("ps.getBlendSrcFunc() == bsf", ps.getBlendSrcFunc() == bsf);
- _RS_ASSERT("ps.getBlendDstFunc() == bdf", ps.getBlendDstFunc() == bdf);
- _RS_ASSERT("ps.getColorMaskREnabled() == R", ps.getColorMaskREnabled() == R);
- _RS_ASSERT("ps.getColorMaskGEnabled() == G", ps.getColorMaskGEnabled() == G);
- _RS_ASSERT("ps.getColorMaskBEnabled() == B", ps.getColorMaskBEnabled() == B);
- _RS_ASSERT("ps.getColorMaskAEnabled() == A", ps.getColorMaskAEnabled() == A);
- _RS_ASSERT("ps.getDitherEnabled() == dither", ps.getDitherEnabled() == dither);
- }
-
- void varyBuilderColorAndDither(ProgramStore.Builder pb,
- boolean depthMask,
- DepthFunc df,
- BlendSrcFunc bsf,
- BlendDstFunc bdf) {
- for (int r = 0; r <= 1; r++) {
- boolean isR = (r == 1);
- for (int g = 0; g <= 1; g++) {
- boolean isG = (g == 1);
- for (int b = 0; b <= 1; b++) {
- boolean isB = (b == 1);
- for (int a = 0; a <= 1; a++) {
- boolean isA = (a == 1);
- for (int dither = 0; dither <= 1; dither++) {
- boolean isDither = (dither == 1);
- pb.setDitherEnabled(isDither);
- pb.setColorMaskEnabled(isR, isG, isB, isA);
- ProgramStore ps = pb.create();
- checkObject(ps, depthMask, df, bsf, bdf, isR, isG, isB, isA, isDither);
- }
- }
- }
- }
- }
- }
-
- public void testJavaSide(RenderScript RS) {
- for (int depth = 0; depth <= 1; depth++) {
- boolean depthMask = (depth == 1);
- for (DepthFunc df : DepthFunc.values()) {
- for (BlendSrcFunc bsf : BlendSrcFunc.values()) {
- for (BlendDstFunc bdf : BlendDstFunc.values()) {
- ProgramStore.Builder b = new ProgramStore.Builder(RS);
- b.setDepthFunc(df);
- b.setDepthMaskEnabled(depthMask);
- b.setBlendFunc(bsf, bdf);
- varyBuilderColorAndDither(b, depthMask, df, bsf, bdf);
- }
- }
- }
- }
- }
-
- public void run() {
- RenderScript pRS = RenderScript.create(mCtx);
- testJavaSide(pRS);
- testScriptSide(pRS);
- pRS.destroy();
- }
-}
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_sampler.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_sampler.java
deleted file mode 100644
index 030b3ff..0000000
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_sampler.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.rs.test;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.renderscript.*;
-import android.renderscript.Sampler;
-import android.renderscript.Sampler.Value;
-
-public class UT_sampler extends UnitTest {
- private Resources mRes;
-
- Sampler minification;
- Sampler magnification;
- Sampler wrapS;
- Sampler wrapT;
- Sampler anisotropy;
-
- protected UT_sampler(RSTestCore rstc, Resources res, Context ctx) {
- super(rstc, "Sampler", ctx);
- mRes = res;
- }
-
- private Sampler.Builder getDefaultBuilder(RenderScript RS) {
- Sampler.Builder b = new Sampler.Builder(RS);
- b.setMinification(Value.NEAREST);
- b.setMagnification(Value.NEAREST);
- b.setWrapS(Value.CLAMP);
- b.setWrapT(Value.CLAMP);
- b.setAnisotropy(1.0f);
- return b;
- }
-
- private void initializeGlobals(RenderScript RS, ScriptC_sampler s) {
- Sampler.Builder b = getDefaultBuilder(RS);
- b.setMinification(Value.LINEAR_MIP_LINEAR);
- minification = b.create();
-
- b = getDefaultBuilder(RS);
- b.setMagnification(Value.LINEAR);
- magnification = b.create();
-
- b = getDefaultBuilder(RS);
- b.setWrapS(Value.WRAP);
- wrapS = b.create();
-
- b = getDefaultBuilder(RS);
- b.setWrapT(Value.WRAP);
- wrapT = b.create();
-
- b = getDefaultBuilder(RS);
- b.setAnisotropy(8.0f);
- anisotropy = b.create();
-
- s.set_minification(minification);
- s.set_magnification(magnification);
- s.set_wrapS(wrapS);
- s.set_wrapT(wrapT);
- s.set_anisotropy(anisotropy);
- }
-
- private void testScriptSide(RenderScript pRS) {
- ScriptC_sampler s = new ScriptC_sampler(pRS, mRes, R.raw.sampler);
- pRS.setMessageHandler(mRsMessage);
- initializeGlobals(pRS, s);
- s.invoke_sampler_test();
- pRS.finish();
- waitForMessage();
- }
-
- private void testJavaSide(RenderScript RS) {
- _RS_ASSERT("minification.getMagnification() == Sampler.Value.NEAREST",
- minification.getMagnification() == Sampler.Value.NEAREST);
- _RS_ASSERT("minification.getMinification() == Sampler.Value.LINEAR_MIP_LINEAR",
- minification.getMinification() == Sampler.Value.LINEAR_MIP_LINEAR);
- _RS_ASSERT("minification.getWrapS() == Sampler.Value.CLAMP",
- minification.getWrapS() == Sampler.Value.CLAMP);
- _RS_ASSERT("minification.getWrapT() == Sampler.Value.CLAMP",
- minification.getWrapT() == Sampler.Value.CLAMP);
- _RS_ASSERT("minification.getAnisotropy() == 1.0f",
- minification.getAnisotropy() == 1.0f);
-
- _RS_ASSERT("magnification.getMagnification() == Sampler.Value.LINEAR",
- magnification.getMagnification() == Sampler.Value.LINEAR);
- _RS_ASSERT("magnification.getMinification() == Sampler.Value.NEAREST",
- magnification.getMinification() == Sampler.Value.NEAREST);
- _RS_ASSERT("magnification.getWrapS() == Sampler.Value.CLAMP",
- magnification.getWrapS() == Sampler.Value.CLAMP);
- _RS_ASSERT("magnification.getWrapT() == Sampler.Value.CLAMP",
- magnification.getWrapT() == Sampler.Value.CLAMP);
- _RS_ASSERT("magnification.getAnisotropy() == 1.0f",
- magnification.getAnisotropy() == 1.0f);
-
- _RS_ASSERT("wrapS.getMagnification() == Sampler.Value.NEAREST",
- wrapS.getMagnification() == Sampler.Value.NEAREST);
- _RS_ASSERT("wrapS.getMinification() == Sampler.Value.NEAREST",
- wrapS.getMinification() == Sampler.Value.NEAREST);
- _RS_ASSERT("wrapS.getWrapS() == Sampler.Value.WRAP",
- wrapS.getWrapS() == Sampler.Value.WRAP);
- _RS_ASSERT("wrapS.getWrapT() == Sampler.Value.CLAMP",
- wrapS.getWrapT() == Sampler.Value.CLAMP);
- _RS_ASSERT("wrapS.getAnisotropy() == 1.0f",
- wrapS.getAnisotropy() == 1.0f);
-
- _RS_ASSERT("wrapT.getMagnification() == Sampler.Value.NEAREST",
- wrapT.getMagnification() == Sampler.Value.NEAREST);
- _RS_ASSERT("wrapT.getMinification() == Sampler.Value.NEAREST",
- wrapT.getMinification() == Sampler.Value.NEAREST);
- _RS_ASSERT("wrapT.getWrapS() == Sampler.Value.CLAMP",
- wrapT.getWrapS() == Sampler.Value.CLAMP);
- _RS_ASSERT("wrapT.getWrapT() == Sampler.Value.WRAP",
- wrapT.getWrapT() == Sampler.Value.WRAP);
- _RS_ASSERT("wrapT.getAnisotropy() == 1.0f",
- wrapT.getAnisotropy() == 1.0f);
-
- _RS_ASSERT("anisotropy.getMagnification() == Sampler.Value.NEAREST",
- anisotropy.getMagnification() == Sampler.Value.NEAREST);
- _RS_ASSERT("anisotropy.getMinification() == Sampler.Value.NEAREST",
- anisotropy.getMinification() == Sampler.Value.NEAREST);
- _RS_ASSERT("anisotropy.getWrapS() == Sampler.Value.CLAMP",
- anisotropy.getWrapS() == Sampler.Value.CLAMP);
- _RS_ASSERT("anisotropy.getWrapT() == Sampler.Value.CLAMP",
- anisotropy.getWrapT() == Sampler.Value.CLAMP);
- _RS_ASSERT("anisotropy.getAnisotropy() == 1.0f",
- anisotropy.getAnisotropy() == 8.0f);
-
- updateUI();
- }
-
- public void run() {
- RenderScript pRS = RenderScript.create(mCtx);
- testScriptSide(pRS);
- testJavaSide(pRS);
- pRS.destroy();
- }
-}
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/program_raster.rs b/tests/RenderScriptTests/tests/src/com/android/rs/test/program_raster.rs
deleted file mode 100644
index 11b8c30..0000000
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/program_raster.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-#include "shared.rsh"
-#include "rs_graphics.rsh"
-
-rs_program_raster pointSpriteEnabled;
-rs_program_raster cullMode;
-
-static bool test_program_raster_getters() {
- bool failed = false;
-
- _RS_ASSERT(rsgProgramRasterGetPointSpriteEnabled(pointSpriteEnabled) == true);
- _RS_ASSERT(rsgProgramRasterGetCullMode(pointSpriteEnabled) == RS_CULL_BACK);
-
- _RS_ASSERT(rsgProgramRasterGetPointSpriteEnabled(cullMode) == false);
- _RS_ASSERT(rsgProgramRasterGetCullMode(cullMode) == RS_CULL_FRONT);
-
- if (failed) {
- rsDebug("test_program_raster_getters FAILED", 0);
- }
- else {
- rsDebug("test_program_raster_getters PASSED", 0);
- }
-
- return failed;
-}
-
-void program_raster_test() {
- bool failed = false;
- failed |= test_program_raster_getters();
-
- if (failed) {
- rsSendToClientBlocking(RS_MSG_TEST_FAILED);
- }
- else {
- rsSendToClientBlocking(RS_MSG_TEST_PASSED);
- }
-}
-
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/program_store.rs b/tests/RenderScriptTests/tests/src/com/android/rs/test/program_store.rs
deleted file mode 100644
index 3cd8a20..0000000
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/program_store.rs
+++ /dev/null
@@ -1,128 +0,0 @@
-#include "shared.rsh"
-#include "rs_graphics.rsh"
-
-rs_program_store ditherEnable;
-rs_program_store colorRWriteEnable;
-rs_program_store colorGWriteEnable;
-rs_program_store colorBWriteEnable;
-rs_program_store colorAWriteEnable;
-rs_program_store blendSrc;
-rs_program_store blendDst;
-rs_program_store depthWriteEnable;
-rs_program_store depthFunc;
-
-static bool test_program_store_getters() {
- bool failed = false;
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(depthFunc) == RS_DEPTH_FUNC_GREATER);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(depthFunc) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(depthFunc) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(depthFunc) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(depthFunc) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(depthFunc) == false);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(depthFunc) == false);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(depthFunc) == RS_BLEND_SRC_ZERO);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(depthFunc) == RS_BLEND_DST_ZERO);
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(depthWriteEnable) == RS_DEPTH_FUNC_ALWAYS);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(depthWriteEnable) == true);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(depthWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(depthWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(depthWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(depthWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(depthWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(depthWriteEnable) == RS_BLEND_SRC_ZERO);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(depthWriteEnable) == RS_BLEND_DST_ZERO);
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(colorRWriteEnable) == RS_DEPTH_FUNC_ALWAYS);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(colorRWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(colorRWriteEnable) == true);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(colorRWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(colorRWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(colorRWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(colorRWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(colorRWriteEnable) == RS_BLEND_SRC_ZERO);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(colorRWriteEnable) == RS_BLEND_DST_ZERO);
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(colorGWriteEnable) == RS_DEPTH_FUNC_ALWAYS);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(colorGWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(colorGWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(colorGWriteEnable) == true);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(colorGWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(colorGWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(colorGWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(colorGWriteEnable) == RS_BLEND_SRC_ZERO);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(colorGWriteEnable) == RS_BLEND_DST_ZERO);
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(colorBWriteEnable) == RS_DEPTH_FUNC_ALWAYS);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(colorBWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(colorBWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(colorBWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(colorBWriteEnable) == true);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(colorBWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(colorBWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(colorBWriteEnable) == RS_BLEND_SRC_ZERO);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(colorBWriteEnable) == RS_BLEND_DST_ZERO);
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(colorAWriteEnable) == RS_DEPTH_FUNC_ALWAYS);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(colorAWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(colorAWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(colorAWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(colorAWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(colorAWriteEnable) == true);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(colorAWriteEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(colorAWriteEnable) == RS_BLEND_SRC_ZERO);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(colorAWriteEnable) == RS_BLEND_DST_ZERO);
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(ditherEnable) == RS_DEPTH_FUNC_ALWAYS);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(ditherEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(ditherEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(ditherEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(ditherEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(ditherEnable) == false);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(ditherEnable) == true);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(ditherEnable) == RS_BLEND_SRC_ZERO);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(ditherEnable) == RS_BLEND_DST_ZERO);
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(blendSrc) == RS_DEPTH_FUNC_ALWAYS);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(blendSrc) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(blendSrc) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(blendSrc) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(blendSrc) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(blendSrc) == false);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(blendSrc) == false);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(blendSrc) == RS_BLEND_SRC_DST_COLOR);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(blendSrc) == RS_BLEND_DST_ZERO);
-
- _RS_ASSERT(rsgProgramStoreGetDepthFunc(blendDst) == RS_DEPTH_FUNC_ALWAYS);
- _RS_ASSERT(rsgProgramStoreGetDepthMask(blendDst) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskR(blendDst) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskG(blendDst) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskB(blendDst) == false);
- _RS_ASSERT(rsgProgramStoreGetColorMaskA(blendDst) == false);
- _RS_ASSERT(rsgProgramStoreGetDitherEnabled(blendDst) == false);
- _RS_ASSERT(rsgProgramStoreGetBlendSrcFunc(blendDst) == RS_BLEND_SRC_ZERO);
- _RS_ASSERT(rsgProgramStoreGetBlendDstFunc(blendDst) == RS_BLEND_DST_DST_ALPHA);
-
- if (failed) {
- rsDebug("test_program_store_getters FAILED", 0);
- }
- else {
- rsDebug("test_program_store_getters PASSED", 0);
- }
-
- return failed;
-}
-
-void program_store_test() {
- bool failed = false;
- failed |= test_program_store_getters();
-
- if (failed) {
- rsSendToClientBlocking(RS_MSG_TEST_FAILED);
- }
- else {
- rsSendToClientBlocking(RS_MSG_TEST_PASSED);
- }
-}
-
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/sampler.rs b/tests/RenderScriptTests/tests/src/com/android/rs/test/sampler.rs
deleted file mode 100644
index ac9a549..0000000
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/sampler.rs
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "shared.rsh"
-#include "rs_graphics.rsh"
-rs_sampler minification;
-rs_sampler magnification;
-rs_sampler wrapS;
-rs_sampler wrapT;
-rs_sampler anisotropy;
-
-static bool test_sampler_getters() {
- bool failed = false;
-
- _RS_ASSERT(rsgSamplerGetMagnification(minification) == RS_SAMPLER_NEAREST);
- _RS_ASSERT(rsgSamplerGetMinification(minification) == RS_SAMPLER_LINEAR_MIP_LINEAR);
- _RS_ASSERT(rsgSamplerGetWrapS(minification) == RS_SAMPLER_CLAMP);
- _RS_ASSERT(rsgSamplerGetWrapT(minification) == RS_SAMPLER_CLAMP);
- _RS_ASSERT(rsgSamplerGetAnisotropy(minification) == 1.0f);
-
- _RS_ASSERT(rsgSamplerGetMagnification(magnification) == RS_SAMPLER_LINEAR);
- _RS_ASSERT(rsgSamplerGetMinification(magnification) == RS_SAMPLER_NEAREST);
- _RS_ASSERT(rsgSamplerGetWrapS(magnification) == RS_SAMPLER_CLAMP);
- _RS_ASSERT(rsgSamplerGetWrapT(magnification) == RS_SAMPLER_CLAMP);
- _RS_ASSERT(rsgSamplerGetAnisotropy(magnification) == 1.0f);
-
- _RS_ASSERT(rsgSamplerGetMagnification(wrapS) == RS_SAMPLER_NEAREST);
- _RS_ASSERT(rsgSamplerGetMinification(wrapS) == RS_SAMPLER_NEAREST);
- _RS_ASSERT(rsgSamplerGetWrapS(wrapS) == RS_SAMPLER_WRAP);
- _RS_ASSERT(rsgSamplerGetWrapT(wrapS) == RS_SAMPLER_CLAMP);
- _RS_ASSERT(rsgSamplerGetAnisotropy(wrapS) == 1.0f);
-
- _RS_ASSERT(rsgSamplerGetMagnification(wrapT) == RS_SAMPLER_NEAREST);
- _RS_ASSERT(rsgSamplerGetMinification(wrapT) == RS_SAMPLER_NEAREST);
- _RS_ASSERT(rsgSamplerGetWrapS(wrapT) == RS_SAMPLER_CLAMP);
- _RS_ASSERT(rsgSamplerGetWrapT(wrapT) == RS_SAMPLER_WRAP);
- _RS_ASSERT(rsgSamplerGetAnisotropy(wrapT) == 1.0f);
-
- _RS_ASSERT(rsgSamplerGetMagnification(anisotropy) == RS_SAMPLER_NEAREST);
- _RS_ASSERT(rsgSamplerGetMinification(anisotropy) == RS_SAMPLER_NEAREST);
- _RS_ASSERT(rsgSamplerGetWrapS(anisotropy) == RS_SAMPLER_CLAMP);
- _RS_ASSERT(rsgSamplerGetWrapT(anisotropy) == RS_SAMPLER_CLAMP);
- _RS_ASSERT(rsgSamplerGetAnisotropy(anisotropy) == 8.0f);
-
- if (failed) {
- rsDebug("test_sampler_getters FAILED", 0);
- }
- else {
- rsDebug("test_sampler_getters PASSED", 0);
- }
-
- return failed;
-}
-
-void sampler_test() {
- bool failed = false;
- failed |= test_sampler_getters();
-
- if (failed) {
- rsSendToClientBlocking(RS_MSG_TEST_FAILED);
- }
- else {
- rsSendToClientBlocking(RS_MSG_TEST_PASSED);
- }
-}
-