Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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 | #ifndef ANDROID_RS_SCRIPT_C_H |
| 18 | #define ANDROID_RS_SCRIPT_C_H |
| 19 | |
| 20 | #include "rsScript.h" |
| 21 | |
| 22 | #include "RenderScriptEnv.h" |
| 23 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame^] | 24 | struct ACCscript; |
| 25 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 26 | // --------------------------------------------------------------------------- |
| 27 | namespace android { |
| 28 | namespace renderscript { |
| 29 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame^] | 30 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 31 | |
| 32 | class ScriptC : public Script |
| 33 | { |
| 34 | public: |
| 35 | |
| 36 | ScriptC(); |
| 37 | virtual ~ScriptC(); |
| 38 | |
| 39 | |
| 40 | virtual void run(Context *, uint32_t launchID); |
| 41 | |
| 42 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame^] | 43 | ACCscript* mAccScript; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 44 | rsc_RunScript mScript; |
| 45 | |
| 46 | |
| 47 | struct Env { |
| 48 | Context *mContext; |
| 49 | ScriptC *mScript; |
| 50 | }; |
| 51 | |
| 52 | }; |
| 53 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame^] | 54 | class ScriptCState |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 55 | { |
| 56 | public: |
| 57 | ScriptCState(); |
| 58 | ~ScriptCState(); |
| 59 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame^] | 60 | ACCscript* mAccScript; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 61 | rsc_RunScript mScript; |
| 62 | float mClearColor[4]; |
| 63 | float mClearDepth; |
| 64 | uint32_t mClearStencil; |
| 65 | bool mIsRoot; |
| 66 | bool mIsOrtho; |
| 67 | |
| 68 | Vector<const Type *> mConstantBufferTypes; |
| 69 | |
| 70 | void clear(); |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | } |
| 75 | } |
| 76 | #endif |
| 77 | |
| 78 | |
| 79 | |