1648a1c137663ef7207684d0d7009dd5518942111Stephen Hines/*
2648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * Copyright (C) 2013 The Android Open Source Project
3648a1c137663ef7207684d0d7009dd5518942111Stephen Hines *
4648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * Licensed under the Apache License, Version 2.0 (the "License");
5648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * you may not use this file except in compliance with the License.
6648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * You may obtain a copy of the License at
7648a1c137663ef7207684d0d7009dd5518942111Stephen Hines *
8648a1c137663ef7207684d0d7009dd5518942111Stephen Hines *      http://www.apache.org/licenses/LICENSE-2.0
9648a1c137663ef7207684d0d7009dd5518942111Stephen Hines *
10648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * Unless required by applicable law or agreed to in writing, software
11648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * distributed under the License is distributed on an "AS IS" BASIS,
12648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * See the License for the specific language governing permissions and
14648a1c137663ef7207684d0d7009dd5518942111Stephen Hines * limitations under the License.
15648a1c137663ef7207684d0d7009dd5518942111Stephen Hines */
16648a1c137663ef7207684d0d7009dd5518942111Stephen Hines
17648a1c137663ef7207684d0d7009dd5518942111Stephen Hinespackage com.android.rs.test_compatlegacy;
18648a1c137663ef7207684d0d7009dd5518942111Stephen Hines
19648a1c137663ef7207684d0d7009dd5518942111Stephen Hinesimport android.content.Context;
20648a1c137663ef7207684d0d7009dd5518942111Stephen Hinesimport android.content.res.Resources;
21648a1c137663ef7207684d0d7009dd5518942111Stephen Hinesimport android.support.v8.renderscript.*;
22648a1c137663ef7207684d0d7009dd5518942111Stephen Hines
23648a1c137663ef7207684d0d7009dd5518942111Stephen Hinespublic class UT_clamp extends UnitTest {
24648a1c137663ef7207684d0d7009dd5518942111Stephen Hines    private Resources mRes;
25648a1c137663ef7207684d0d7009dd5518942111Stephen Hines
26648a1c137663ef7207684d0d7009dd5518942111Stephen Hines    protected UT_clamp(RSTestCore rstc, Resources res, Context ctx) {
27648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        super(rstc, "Clamp (Full)", ctx);
28648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        mRes = res;
29648a1c137663ef7207684d0d7009dd5518942111Stephen Hines    }
30648a1c137663ef7207684d0d7009dd5518942111Stephen Hines
31648a1c137663ef7207684d0d7009dd5518942111Stephen Hines    public void run() {
32648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        RenderScript pRS = RenderScript.create(mCtx);
33648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        ScriptC_clamp s = new ScriptC_clamp(pRS);
34648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        pRS.setMessageHandler(mRsMessage);
35648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        s.invoke_clamp_test();
36648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        pRS.finish();
37648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        waitForMessage();
38648a1c137663ef7207684d0d7009dd5518942111Stephen Hines        pRS.destroy();
39648a1c137663ef7207684d0d7009dd5518942111Stephen Hines    }
40648a1c137663ef7207684d0d7009dd5518942111Stephen Hines}
41