1 /* 2 * Copyright (C) 2011 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.scenegraph; 18 19 import java.lang.Math; 20 import java.util.ArrayList; 21 22 import com.android.scenegraph.SceneManager; 23 24 import android.renderscript.Allocation; 25 import android.renderscript.Element; 26 import android.renderscript.Matrix4f; 27 import android.renderscript.ProgramFragment; 28 import android.renderscript.ProgramStore; 29 import android.renderscript.ProgramVertex; 30 import android.renderscript.RSRuntimeException; 31 import android.renderscript.RenderScript; 32 import android.renderscript.RenderScriptGL; 33 import android.util.Log; 34 35 /** 36 * @hide 37 */ 38 public abstract class SceneGraphBase { 39 String mName; 40 Allocation mNameAlloc; setName(String n)41 public void setName(String n) { 42 mName = n; 43 mNameAlloc = null; 44 } 45 getName()46 public String getName() { 47 return mName; 48 } 49 getNameAlloc(RenderScriptGL rs)50 Allocation getNameAlloc(RenderScriptGL rs) { 51 if (mNameAlloc == null) { 52 mNameAlloc = SceneManager.getStringAsAllocation(rs, getName()); 53 } 54 return mNameAlloc; 55 } 56 } 57 58 59 60 61 62