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 
17 package com.android.rs.image;
18 
19 import java.lang.Math;
20 
21 import android.renderscript.Allocation;
22 import android.renderscript.Element;
23 import android.renderscript.RenderScript;
24 import android.renderscript.Script;
25 import android.renderscript.ScriptC;
26 import android.renderscript.Type;
27 import android.util.Log;
28 
29 public class Mirror extends TestBase {
30     private ScriptC_mirror mScript;
31     private int mWidth;
32     private int mHeight;
33 
createTest(android.content.res.Resources res)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 
runTest()45     public void runTest() {
46         mScript.forEach_mirror(mOutPixelsAllocation);
47     }
48 
49 }
50