1/* 2 * Copyright (C) 2012 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 %PACKAGE%; 18 19import android.content.res.Resources; 20import android.renderscript.*; 21 22// This is the renderer for the driver 23public class DriverRS { 24 private Resources mRes; 25 private RenderScriptGL mRS; 26 27 private ScriptC_%TESTCASE% mScript; 28 29 public DriverRS() { 30 } 31 32 // This provides us with the renderscript context and resources that 33 // allow us to create the script that does rendering 34 public void init(RenderScriptGL rs, Resources res) { 35 mRS = rs; 36 mRes = res; 37 initRS(); 38 } 39 40 private void initRS() { 41 mScript = new ScriptC_%TESTCASE% (mRS, mRes, R.raw.%TESTCASE%); 42 mScript.invoke_entry(40); 43 } 44} 45 46