2009-05-22 14:03:28 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2009 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ANDROID_RS_SCRIPT_H
|
|
|
|
#define ANDROID_RS_SCRIPT_H
|
|
|
|
|
|
|
|
#include "rsAllocation.h"
|
|
|
|
|
2009-06-10 15:04:38 -07:00
|
|
|
|
2009-05-22 14:03:28 -07:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
namespace android {
|
|
|
|
namespace renderscript {
|
|
|
|
|
2009-06-10 15:04:38 -07:00
|
|
|
class ProgramVertex;
|
|
|
|
class ProgramFragment;
|
|
|
|
class ProgramRaster;
|
|
|
|
class ProgramFragmentStore;
|
2009-05-22 14:03:28 -07:00
|
|
|
|
2009-08-12 17:54:11 -07:00
|
|
|
#define MAX_SCRIPT_BANKS 16
|
|
|
|
|
2009-05-22 14:03:28 -07:00
|
|
|
class Script : public ObjectBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Script();
|
|
|
|
virtual ~Script();
|
|
|
|
|
|
|
|
|
2009-06-08 18:50:13 -07:00
|
|
|
struct Enviroment_t {
|
|
|
|
bool mIsRoot;
|
|
|
|
float mClearColor[4];
|
|
|
|
float mClearDepth;
|
|
|
|
uint32_t mClearStencil;
|
|
|
|
|
2009-07-30 18:45:01 -07:00
|
|
|
uint32_t mStartTimeMillis;
|
|
|
|
const char* mTimeZone;
|
|
|
|
|
2009-06-10 15:04:38 -07:00
|
|
|
ObjectBaseRef<ProgramVertex> mVertex;
|
|
|
|
ObjectBaseRef<ProgramFragment> mFragment;
|
|
|
|
//ObjectBaseRef<ProgramRaster> mRaster;
|
|
|
|
ObjectBaseRef<ProgramFragmentStore> mFragmentStore;
|
2009-06-09 12:15:30 -07:00
|
|
|
|
2009-06-08 18:50:13 -07:00
|
|
|
};
|
|
|
|
Enviroment_t mEnviroment;
|
2009-05-22 14:03:28 -07:00
|
|
|
|
|
|
|
uint32_t mCounstantBufferCount;
|
|
|
|
|
2009-08-12 17:54:11 -07:00
|
|
|
ObjectBaseRef<Allocation> mSlots[MAX_SCRIPT_BANKS];
|
2009-08-13 12:59:04 -07:00
|
|
|
ObjectBaseRef<const Type> mTypes[MAX_SCRIPT_BANKS];
|
|
|
|
String8 mSlotNames[MAX_SCRIPT_BANKS];
|
2009-05-22 14:03:28 -07:00
|
|
|
|
2009-06-04 17:58:03 -07:00
|
|
|
virtual bool run(Context *, uint32_t launchID) = 0;
|
2009-05-22 14:03:28 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|