1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.rs.image;
18
19import java.lang.Math;
20
21import android.renderscript.Allocation;
22import android.renderscript.Element;
23import android.renderscript.RenderScript;
24import android.renderscript.Script;
25import android.renderscript.ScriptC;
26import android.renderscript.Type;
27import android.util.Log;
28
29public class Mirror extends TestBase {
30    private ScriptC_mirror mScript;
31    private int mWidth;
32    private int mHeight;
33
34    public void createTest(android.content.res.Resources res) {
35        mScript = new ScriptC_mirror(mRS);
36
37        mWidth = mInPixelsAllocation.getType().getX();
38        mHeight = mInPixelsAllocation.getType().getY();
39
40        mScript.set_gIn(mInPixelsAllocation);
41        mScript.set_gWidth(mWidth);
42        mScript.set_gHeight(mHeight);
43    }
44
45    public void runTest() {
46        mScript.forEach_mirror(mOutPixelsAllocation);
47    }
48
49}
50