rsScriptGroup2.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "rsScriptGroup2.h"
  2. #include "rsContext.h"
  3. namespace android {
  4. namespace renderscript {
  5. ScriptGroup2::~ScriptGroup2() {
  6. if (mRSC->mHal.funcs.scriptgroup.destroy) {
  7. mRSC->mHal.funcs.scriptgroup.destroy(mRSC, this);
  8. }
  9. }
  10. void ScriptGroup2::execute(Context* rsc) {
  11. if (rsc->mHal.funcs.scriptgroup.execute) {
  12. rsc->mHal.funcs.scriptgroup.execute(rsc, this);
  13. }
  14. }
  15. RsScriptGroup2 rsi_ScriptGroup2Create(Context* rsc, const char* name,
  16. size_t nameLength,
  17. const char* cacheDir,
  18. size_t cacheDirLength,
  19. RsClosure* closures, size_t numClosures) {
  20. ScriptGroup2* group = new ScriptGroup2(rsc, name, cacheDir,
  21. (Closure**)closures, numClosures);
  22. // Create a device-specific implementation by calling the device driver
  23. if (rsc->mHal.funcs.scriptgroup.init) {
  24. rsc->mHal.funcs.scriptgroup.init(rsc, group);
  25. }
  26. group->incUserRef();
  27. return group;
  28. }
  29. } // namespace renderscript
  30. } // namespace android