ISurfaceComposerClient.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (C) 2007 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 ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
  17. #define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. #include <utils/Errors.h>
  21. #include <utils/RefBase.h>
  22. #include <binder/IInterface.h>
  23. #include <ui/FrameStats.h>
  24. #include <ui/PixelFormat.h>
  25. namespace android {
  26. // ----------------------------------------------------------------------------
  27. class IGraphicBufferProducer;
  28. class ISurfaceComposerClient : public IInterface
  29. {
  30. public:
  31. DECLARE_META_INTERFACE(SurfaceComposerClient);
  32. // flags for createSurface()
  33. enum { // (keep in sync with Surface.java)
  34. eHidden = 0x00000004,
  35. eDestroyBackbuffer = 0x00000020,
  36. eSecure = 0x00000080,
  37. eNonPremultiplied = 0x00000100,
  38. eOpaque = 0x00000400,
  39. eProtectedByApp = 0x00000800,
  40. eProtectedByDRM = 0x00001000,
  41. eCursorWindow = 0x00002000,
  42. eFXSurfaceNormal = 0x00000000,
  43. eFXSurfaceBlur = 0x00010000,
  44. eFXSurfaceDim = 0x00020000,
  45. eFXSurfaceMask = 0x000F0000,
  46. };
  47. /*
  48. * Requires ACCESS_SURFACE_FLINGER permission
  49. */
  50. virtual status_t createSurface(
  51. const String8& name, uint32_t w, uint32_t h,
  52. PixelFormat format, uint32_t flags,
  53. sp<IBinder>* handle,
  54. sp<IGraphicBufferProducer>* gbp) = 0;
  55. /*
  56. * Requires ACCESS_SURFACE_FLINGER permission
  57. */
  58. virtual status_t destroySurface(const sp<IBinder>& handle) = 0;
  59. /*
  60. * Requires ACCESS_SURFACE_FLINGER permission
  61. */
  62. virtual status_t clearLayerFrameStats(const sp<IBinder>& handle) const = 0;
  63. /*
  64. * Requires ACCESS_SURFACE_FLINGER permission
  65. */
  66. virtual status_t getLayerFrameStats(const sp<IBinder>& handle, FrameStats* outStats) const = 0;
  67. };
  68. // ----------------------------------------------------------------------------
  69. class BnSurfaceComposerClient: public BnInterface<ISurfaceComposerClient> {
  70. public:
  71. virtual status_t onTransact(uint32_t code, const Parcel& data,
  72. Parcel* reply, uint32_t flags = 0);
  73. };
  74. // ----------------------------------------------------------------------------
  75. }; // namespace android
  76. #endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H