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
17package com.android.scenegraph;
18
19import java.lang.Math;
20import java.util.ArrayList;
21
22import com.android.scenegraph.SceneManager;
23
24import android.renderscript.Allocation;
25import android.renderscript.Element;
26import android.renderscript.Matrix4f;
27import android.renderscript.ProgramFragment;
28import android.renderscript.ProgramStore;
29import android.renderscript.ProgramVertex;
30import android.renderscript.RSRuntimeException;
31import android.renderscript.RenderScript;
32import android.renderscript.RenderScriptGL;
33import android.util.Log;
34
35/**
36 * @hide
37 */
38public abstract class SceneGraphBase {
39    String mName;
40    Allocation mNameAlloc;
41    public void setName(String n) {
42        mName = n;
43        mNameAlloc = null;
44    }
45
46    public String getName() {
47        return mName;
48    }
49
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