GLES11RenderEngine.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright 2013 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. #ifndef SF_GLES11RENDERENGINE_H_
  17. #define SF_GLES11RENDERENGINE_H_
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. #include <GLES/gl.h>
  21. #include <Transform.h>
  22. #include "RenderEngine.h"
  23. // ---------------------------------------------------------------------------
  24. namespace android {
  25. // ---------------------------------------------------------------------------
  26. class String8;
  27. class Mesh;
  28. class Texture;
  29. class GLES11RenderEngine : public RenderEngine {
  30. GLuint mProtectedTexName;
  31. GLint mMaxViewportDims[2];
  32. GLint mMaxTextureSize;
  33. virtual void bindImageAsFramebuffer(EGLImageKHR image,
  34. uint32_t* texName, uint32_t* fbName, uint32_t* status, bool useReadPixels,
  35. int reqWidth, int reqHeight);
  36. virtual void unbindFramebuffer(uint32_t texName, uint32_t fbName, bool useReadPixels);
  37. public:
  38. GLES11RenderEngine();
  39. protected:
  40. virtual ~GLES11RenderEngine();
  41. virtual void dump(String8& result);
  42. virtual void setViewportAndProjection(size_t vpw, size_t vph,
  43. Rect sourceCrop, size_t hwh, bool yswap, Transform::orientation_flags rotation);
  44. virtual void setupLayerBlending(bool premultipliedAlpha, bool opaque, int alpha);
  45. virtual void setupDimLayerBlending(int alpha);
  46. virtual void setupLayerTexturing(const Texture& texture);
  47. virtual void setupLayerBlackedOut();
  48. virtual void setupFillWithColor(float r, float g, float b, float a) ;
  49. virtual void disableTexturing();
  50. virtual void disableBlending();
  51. virtual void setupLayerMasking(const Texture& /*maskTexture*/, float /*alphaThreshold*/) {}
  52. virtual void disableLayerMasking() {}
  53. virtual void drawMesh(const Mesh& mesh);
  54. virtual size_t getMaxTextureSize() const;
  55. virtual size_t getMaxViewportDims() const;
  56. };
  57. // ---------------------------------------------------------------------------
  58. }; // namespace android
  59. // ---------------------------------------------------------------------------
  60. #endif /* SF_GLES11RENDERENGINE_H_ */