ExSurfaceFlinger.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
  2. *
  3. * Redistribution and use in source and binary forms, with or without
  4. * modification, are permitted provided that the following conditions are
  5. * met:
  6. * * Redistributions of source code must retain the above copyright
  7. * notice, this list of conditions and the following disclaimer.
  8. * * Redistributions in binary form must reproduce the above
  9. * copyright notice, this list of conditions and the following
  10. * disclaimer in the documentation and/or other materials provided
  11. * with the distribution.
  12. * * Neither the name of The Linux Foundation nor the names of its
  13. * contributors may be used to endorse or promote products derived
  14. * from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  17. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  19. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  20. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  23. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  25. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  26. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. #ifndef ANDROID_EX_SURFACE_FLINGER_H
  29. #define ANDROID_EX_SURFACE_FLINGER_H
  30. #include "SurfaceFlinger.h"
  31. namespace android {
  32. class ExSurfaceFlinger : public SurfaceFlinger
  33. {
  34. public:
  35. ExSurfaceFlinger();
  36. protected:
  37. friend class ExLayer;
  38. virtual void updateExtendedMode();
  39. virtual void getIndexLOI(size_t dpy,
  40. const LayerVector& currentLayers,
  41. bool& bIgnoreLayers,
  42. int& indexLOI);
  43. virtual bool updateLayerVisibleNonTransparentRegion(
  44. const int& dpy, const sp<Layer>& layer,
  45. bool& bIgnoreLayers, int& indexLOI,
  46. uint32_t layerStack, const int& i);
  47. virtual void delayDPTransactionIfNeeded(
  48. const Vector<DisplayState>& displays);
  49. virtual bool canDrawLayerinScreenShot(
  50. const sp<const DisplayDevice>& hw,
  51. const sp<Layer>& layer);
  52. virtual void isfreezeSurfacePresent(
  53. bool& freezeSurfacePresent,
  54. const sp<const DisplayDevice>& hw,
  55. const int32_t& id);
  56. virtual void setOrientationEventControl(
  57. bool& freezeSurfacePresent,
  58. const int32_t& id);
  59. virtual void updateVisibleRegionsDirty();
  60. virtual void drawWormHoleIfRequired(HWComposer::LayerListIterator& /*cur*/,
  61. const HWComposer::LayerListIterator& /*end*/,
  62. const sp<const DisplayDevice>& hw,
  63. const Region& region);
  64. virtual ~ExSurfaceFlinger();
  65. /* Extended Mode
  66. * No video on primary but video will be shown full
  67. * screen on External
  68. */
  69. static bool sExtendedMode;
  70. static bool isExtendedMode() { return sExtendedMode; }
  71. bool mDebugLogs;
  72. bool isDebug() { return mDebugLogs; }
  73. bool mDisableExtAnimation;
  74. #ifdef DEBUG_CONT_DUMPSYS
  75. virtual status_t dump(int fd, const Vector<String16>& args);
  76. virtual void dumpDrawCycle(bool prePrepare );
  77. struct {
  78. Mutex lock;
  79. const char *name = "/data/misc/display/dumpsys.txt";
  80. bool running = false;
  81. bool noLimit = false;
  82. bool replaceAfterCommit = false;
  83. long int position = 0;
  84. } mFileDump;
  85. #endif
  86. };
  87. }; //namespace android
  88. #endif //ANDROID_EX_SURFACE_FLINGER_H