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 | |
Jason Sams | a09f11d | 2009-06-04 17:58:03 -0700 | [diff] [blame] | 40 | virtual bool run(Context *, uint32_t launchID); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 41 | |
Jason Sams | 39ddc950 | 2009-06-05 17:35:09 -0700 | [diff] [blame^] | 42 | const char * mScriptText; |
| 43 | uint32_t mScriptTextLength; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 44 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame] | 45 | ACCscript* mAccScript; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 46 | rsc_RunScript mScript; |
| 47 | |
| 48 | |
| 49 | struct Env { |
| 50 | Context *mContext; |
| 51 | ScriptC *mScript; |
| 52 | }; |
| 53 | |
| 54 | }; |
| 55 | |
Jack Palevich | ec5a20b | 2009-05-28 15:53:04 -0700 | [diff] [blame] | 56 | class ScriptCState |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 57 | { |
| 58 | public: |
| 59 | ScriptCState(); |
| 60 | ~ScriptCState(); |
| 61 | |
Jason Sams | 39ddc950 | 2009-06-05 17:35:09 -0700 | [diff] [blame^] | 62 | ACCscript* mAccScript; |
| 63 | const char * mScriptText; |
| 64 | uint32_t mScriptTextLength; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 65 | rsc_RunScript mScript; |
| 66 | float mClearColor[4]; |
| 67 | float mClearDepth; |
| 68 | uint32_t mClearStencil; |
| 69 | bool mIsRoot; |
| 70 | bool mIsOrtho; |
| 71 | |
| 72 | Vector<const Type *> mConstantBufferTypes; |
| 73 | |
| 74 | void clear(); |
Jason Sams | 39ddc950 | 2009-06-05 17:35:09 -0700 | [diff] [blame^] | 75 | void runCompiler(); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 76 | }; |
| 77 | |
| 78 | |
| 79 | } |
| 80 | } |
| 81 | #endif |
| 82 | |
| 83 | |
| 84 | |