1 /* 2 * Copyright (C) 2012 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_INTRINSIC_H 18 #define ANDROID_RS_SCRIPT_INTRINSIC_H 19 20 #include "rsScript.h" 21 22 23 // --------------------------------------------------------------------------- 24 namespace android { 25 namespace renderscript { 26 27 28 class ScriptIntrinsic : public Script { 29 public: 30 31 ObjectBaseRef<const Element> mElement; 32 33 ScriptIntrinsic(Context *); 34 virtual ~ScriptIntrinsic(); 35 36 bool init(Context *rsc, RsScriptIntrinsicID iid, Element *e); 37 38 39 virtual void serialize(Context *rsc, OStream *stream) const; 40 virtual RsA3DClassID getClassId() const; 41 virtual bool freeChildren(); 42 43 virtual void runForEach(Context *rsc, 44 uint32_t slot, 45 const Allocation * ain, 46 Allocation * aout, 47 const void * usr, 48 size_t usrBytes, 49 const RsScriptCall *sc = NULL); 50 51 virtual void runForEach(Context* rsc, 52 uint32_t slot, 53 const Allocation** ains, 54 size_t inLen, 55 Allocation* aout, 56 const void* usr, 57 size_t usrBytes, 58 const RsScriptCall* sc = NULL); 59 60 virtual void Invoke(Context *rsc, uint32_t slot, const void *data, size_t len); 61 virtual void setupScript(Context *rsc); 62 virtual uint32_t run(Context *); 63 protected: 64 uint32_t mIntrinsicID; 65 66 }; 67 68 69 } 70 } 71 #endif 72 73 74