/libs/rs/driver/rsdProgramRaster.cpp

http://github.com/CyanogenMod/android_frameworks_base · C++ · 55 lines · 28 code · 12 blank · 15 comment · 1 complexity · 3a23a06028289a4c8ea1ea43e64924c8 MD5 · raw file

  1. /*
  2. * Copyright (C) 2011 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. #include "rsdCore.h"
  17. #include "rsdProgramStore.h"
  18. #include "rsContext.h"
  19. #include "rsProgramStore.h"
  20. #include <GLES/gl.h>
  21. #include <GLES/glext.h>
  22. using namespace android;
  23. using namespace android::renderscript;
  24. bool rsdProgramRasterInit(const Context *, const ProgramRaster *) {
  25. return true;
  26. }
  27. void rsdProgramRasterSetActive(const Context *rsc, const ProgramRaster *pr) {
  28. switch (pr->mHal.state.cull) {
  29. case RS_CULL_BACK:
  30. RSD_CALL_GL(glEnable, GL_CULL_FACE);
  31. RSD_CALL_GL(glCullFace, GL_BACK);
  32. break;
  33. case RS_CULL_FRONT:
  34. RSD_CALL_GL(glEnable, GL_CULL_FACE);
  35. RSD_CALL_GL(glCullFace, GL_FRONT);
  36. break;
  37. case RS_CULL_NONE:
  38. RSD_CALL_GL(glDisable, GL_CULL_FACE);
  39. break;
  40. }
  41. }
  42. void rsdProgramRasterDestroy(const Context *, const ProgramRaster *) {
  43. }