The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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 | |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 17 | #ifndef ANDROID_DISPLAY_DEVICE_H |
| 18 | #define ANDROID_DISPLAY_DEVICE_H |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 19 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 20 | #include "Transform.h" |
| 21 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | #include <stdlib.h> |
| 23 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 24 | #ifndef USE_HWC2 |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | #include <ui/PixelFormat.h> |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 26 | #endif |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | #include <ui/Region.h> |
| 28 | |
| 29 | #include <EGL/egl.h> |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 30 | #include <EGL/eglext.h> |
| 31 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 32 | #ifdef USE_HWC2 |
| 33 | #include <binder/IBinder.h> |
| 34 | #include <utils/RefBase.h> |
| 35 | #endif |
Mathias Agopian | 8630320 | 2012-07-24 22:46:10 -0700 | [diff] [blame] | 36 | #include <utils/Mutex.h> |
Mathias Agopian | 4f4f094 | 2013-08-19 17:26:18 -0700 | [diff] [blame] | 37 | #include <utils/String8.h> |
Mathias Agopian | 8630320 | 2012-07-24 22:46:10 -0700 | [diff] [blame] | 38 | #include <utils/Timers.h> |
| 39 | |
Mathias Agopian | f435863 | 2012-08-22 17:16:19 -0700 | [diff] [blame] | 40 | #include <hardware/hwcomposer_defs.h> |
| 41 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 42 | #ifdef USE_HWC2 |
| 43 | #include <memory> |
| 44 | #endif |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame] | 45 | |
Mathias Agopian | d8552d7 | 2012-08-04 21:39:11 -0700 | [diff] [blame] | 46 | struct ANativeWindow; |
| 47 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | namespace android { |
| 49 | |
Jesse Hall | 646f541 | 2014-08-07 22:19:07 -0700 | [diff] [blame] | 50 | struct DisplayInfo; |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 51 | class DisplaySurface; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 52 | class Fence; |
Jesse Hall | 9e663de | 2013-08-16 14:28:37 -0700 | [diff] [blame] | 53 | class IGraphicBufferProducer; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 54 | class Layer; |
Mathias Agopian | 8630320 | 2012-07-24 22:46:10 -0700 | [diff] [blame] | 55 | class SurfaceFlinger; |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 56 | class HWComposer; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | |
Mathias Agopian | 028a757 | 2012-08-05 01:23:51 -0700 | [diff] [blame] | 58 | class DisplayDevice : public LightRefBase<DisplayDevice> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 59 | { |
| 60 | public: |
Mathias Agopian | 87baae1 | 2012-07-31 12:38:26 -0700 | [diff] [blame] | 61 | // region in layer-stack space |
| 62 | mutable Region dirtyRegion; |
| 63 | // region in screen space |
| 64 | mutable Region swapRegion; |
| 65 | // region in screen space |
| 66 | Region undefinedRegion; |
Jesse Hall | b7a0549 | 2014-08-14 15:45:06 -0700 | [diff] [blame] | 67 | bool lastCompositionHadVisibleLayers; |
Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 68 | |
Mathias Agopian | 3ee454a | 2012-08-27 16:28:24 -0700 | [diff] [blame] | 69 | enum DisplayType { |
| 70 | DISPLAY_ID_INVALID = -1, |
| 71 | DISPLAY_PRIMARY = HWC_DISPLAY_PRIMARY, |
| 72 | DISPLAY_EXTERNAL = HWC_DISPLAY_EXTERNAL, |
Jesse Hall | 9e663de | 2013-08-16 14:28:37 -0700 | [diff] [blame] | 73 | DISPLAY_VIRTUAL = HWC_DISPLAY_VIRTUAL, |
| 74 | NUM_BUILTIN_DISPLAY_TYPES = HWC_NUM_PHYSICAL_DISPLAY_TYPES, |
Mathias Agopian | 92a979a | 2012-08-02 18:32:23 -0700 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | enum { |
Mathias Agopian | 87baae1 | 2012-07-31 12:38:26 -0700 | [diff] [blame] | 78 | PARTIAL_UPDATES = 0x00020000, // video driver feature |
| 79 | SWAP_RECTANGLE = 0x00080000, |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | }; |
| 81 | |
Jesse Hall | 01e2905 | 2013-02-19 16:13:35 -0800 | [diff] [blame] | 82 | enum { |
| 83 | NO_LAYER_STACK = 0xFFFFFFFF, |
| 84 | }; |
| 85 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 86 | DisplayDevice( |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 87 | const sp<SurfaceFlinger>& flinger, |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 88 | DisplayType type, |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 89 | int32_t hwcId, |
| 90 | #ifndef USE_HWC2 |
Jesse Hall | 19e8729 | 2013-12-23 21:02:15 -0800 | [diff] [blame] | 91 | int format, |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 92 | #endif |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 93 | bool isSecure, |
| 94 | const wp<IBinder>& displayToken, |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 95 | const sp<DisplaySurface>& displaySurface, |
Mathias Agopian | db89edc | 2013-08-02 01:40:18 -0700 | [diff] [blame] | 96 | const sp<IGraphicBufferProducer>& producer, |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 97 | EGLConfig config); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 98 | |
Mathias Agopian | 028a757 | 2012-08-05 01:23:51 -0700 | [diff] [blame] | 99 | ~DisplayDevice(); |
Mathias Agopian | 92a979a | 2012-08-02 18:32:23 -0700 | [diff] [blame] | 100 | |
| 101 | // whether this is a valid object. An invalid DisplayDevice is returned |
| 102 | // when an non existing id is requested |
| 103 | bool isValid() const; |
| 104 | |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 105 | // isSecure indicates whether this display can be trusted to display |
| 106 | // secure surfaces. |
| 107 | bool isSecure() const { return mIsSecure; } |
| 108 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 109 | // Flip the front and back buffers if the back buffer is "dirty". Might |
| 110 | // be instantaneous, might involve copying the frame buffer around. |
| 111 | void flip(const Region& dirty) const; |
| 112 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 113 | int getWidth() const; |
| 114 | int getHeight() const; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 115 | #ifndef USE_HWC2 |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 116 | PixelFormat getFormat() const; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 117 | #endif |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | uint32_t getFlags() const; |
Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 119 | |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 120 | EGLSurface getEGLSurface() const; |
Mathias Agopian | 3b1d2b6 | 2012-07-11 13:48:17 -0700 | [diff] [blame] | 121 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 122 | void setVisibleLayersSortedByZ(const Vector< sp<Layer> >& layers); |
| 123 | const Vector< sp<Layer> >& getVisibleLayersSortedByZ() const; |
Mathias Agopian | cd60f99 | 2012-08-16 16:28:27 -0700 | [diff] [blame] | 124 | Region getDirtyRegion(bool repaintEverything) const; |
Mathias Agopian | 3b1d2b6 | 2012-07-11 13:48:17 -0700 | [diff] [blame] | 125 | |
Mathias Agopian | 28947d7 | 2012-08-08 18:51:15 -0700 | [diff] [blame] | 126 | void setLayerStack(uint32_t stack); |
Michael Lentine | 47e4540 | 2014-07-18 15:34:25 -0700 | [diff] [blame] | 127 | void setDisplaySize(const int newWidth, const int newHeight); |
Mathias Agopian | 00e8c7a | 2012-09-04 19:30:46 -0700 | [diff] [blame] | 128 | void setProjection(int orientation, const Rect& viewport, const Rect& frame); |
Mathias Agopian | 28947d7 | 2012-08-08 18:51:15 -0700 | [diff] [blame] | 129 | |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 130 | int getOrientation() const { return mOrientation; } |
Mathias Agopian | c1c05de | 2013-09-17 23:45:22 -0700 | [diff] [blame] | 131 | uint32_t getOrientationTransform() const; |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 132 | const Transform& getTransform() const { return mGlobalTransform; } |
Mathias Agopian | f5f714a | 2013-02-26 16:54:05 -0800 | [diff] [blame] | 133 | const Rect getViewport() const { return mViewport; } |
| 134 | const Rect getFrame() const { return mFrame; } |
Mathias Agopian | 766dc49 | 2012-10-30 18:08:06 -0700 | [diff] [blame] | 135 | const Rect& getScissor() const { return mScissor; } |
Mathias Agopian | eba8c68 | 2012-09-19 23:14:45 -0700 | [diff] [blame] | 136 | bool needsFiltering() const { return mNeedsFiltering; } |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 137 | |
Mathias Agopian | 87baae1 | 2012-07-31 12:38:26 -0700 | [diff] [blame] | 138 | uint32_t getLayerStack() const { return mLayerStack; } |
Mathias Agopian | 3ee454a | 2012-08-27 16:28:24 -0700 | [diff] [blame] | 139 | int32_t getDisplayType() const { return mType; } |
Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 140 | int32_t getHwcDisplayId() const { return mHwcDisplayId; } |
Mathias Agopian | 3ee454a | 2012-08-27 16:28:24 -0700 | [diff] [blame] | 141 | const wp<IBinder>& getDisplayToken() const { return mDisplayToken; } |
Mathias Agopian | 87baae1 | 2012-07-31 12:38:26 -0700 | [diff] [blame] | 142 | |
Dan Stoza | 7143316 | 2014-02-04 16:22:36 -0800 | [diff] [blame] | 143 | // We pass in mustRecompose so we can keep VirtualDisplaySurface's state |
| 144 | // machine happy without actually queueing a buffer if nothing has changed |
| 145 | status_t beginFrame(bool mustRecompose) const; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 146 | #ifdef USE_HWC2 |
| 147 | status_t prepareFrame(HWComposer& hwc); |
| 148 | #else |
Jesse Hall | 38efe86 | 2013-04-06 23:12:29 -0700 | [diff] [blame] | 149 | status_t prepareFrame(const HWComposer& hwc) const; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 150 | #endif |
Jesse Hall | 38efe86 | 2013-04-06 23:12:29 -0700 | [diff] [blame] | 151 | |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 152 | void swapBuffers(HWComposer& hwc) const; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 153 | #ifndef USE_HWC2 |
Mathias Agopian | 74faca2 | 2009-09-17 16:18:16 -0700 | [diff] [blame] | 154 | status_t compositionComplete() const; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 155 | #endif |
Jesse Hall | 01e2905 | 2013-02-19 16:13:35 -0800 | [diff] [blame] | 156 | |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 157 | // called after h/w composer has completed its set() call |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 158 | #ifdef USE_HWC2 |
| 159 | void onSwapBuffersCompleted() const; |
| 160 | #else |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 161 | void onSwapBuffersCompleted(HWComposer& hwc) const; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 162 | #endif |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 163 | |
Mathias Agopian | 9c6e297 | 2011-09-20 17:21:56 -0700 | [diff] [blame] | 164 | Rect getBounds() const { |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 165 | return Rect(mDisplayWidth, mDisplayHeight); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 166 | } |
Mathias Agopian | 9c6e297 | 2011-09-20 17:21:56 -0700 | [diff] [blame] | 167 | inline Rect bounds() const { return getBounds(); } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 168 | |
Mathias Agopian | 9e2463e | 2012-09-21 18:26:16 -0700 | [diff] [blame] | 169 | void setDisplayName(const String8& displayName); |
Andy McFadden | 8dfa92f | 2012-09-17 18:27:17 -0700 | [diff] [blame] | 170 | const String8& getDisplayName() const { return mDisplayName; } |
| 171 | |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 172 | EGLBoolean makeCurrent(EGLDisplay dpy, EGLContext ctx) const; |
| 173 | void setViewportAndProjection() const; |
Mathias Agopian | bae92d0 | 2012-09-28 01:00:47 -0700 | [diff] [blame] | 174 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 175 | const sp<Fence>& getClientTargetAcquireFence() const; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 176 | |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 177 | /* ------------------------------------------------------------------------ |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 178 | * Display power mode management. |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 179 | */ |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 180 | int getPowerMode() const; |
| 181 | void setPowerMode(int mode); |
| 182 | bool isDisplayOn() const; |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 183 | |
Michael Lentine | 6c9e34a | 2014-07-14 13:48:55 -0700 | [diff] [blame] | 184 | /* ------------------------------------------------------------------------ |
| 185 | * Display active config management. |
| 186 | */ |
| 187 | int getActiveConfig() const; |
| 188 | void setActiveConfig(int mode); |
| 189 | |
Jesse Hall | 02d8656 | 2013-03-25 14:43:23 -0700 | [diff] [blame] | 190 | // release HWC resources (if any) for removable displays |
| 191 | void disconnect(HWComposer& hwc); |
| 192 | |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 193 | /* ------------------------------------------------------------------------ |
| 194 | * Debugging |
| 195 | */ |
| 196 | uint32_t getPageFlipCount() const; |
Mathias Agopian | 74d211a | 2013-04-22 16:55:35 +0200 | [diff] [blame] | 197 | void dump(String8& result) const; |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 198 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 199 | private: |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 200 | /* |
| 201 | * Constants, set during initialization |
| 202 | */ |
Mathias Agopian | c7d14e2 | 2011-08-01 16:32:21 -0700 | [diff] [blame] | 203 | sp<SurfaceFlinger> mFlinger; |
Mathias Agopian | 3ee454a | 2012-08-27 16:28:24 -0700 | [diff] [blame] | 204 | DisplayType mType; |
Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 205 | int32_t mHwcDisplayId; |
Mathias Agopian | 3ee454a | 2012-08-27 16:28:24 -0700 | [diff] [blame] | 206 | wp<IBinder> mDisplayToken; |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 207 | |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 208 | // ANativeWindow this display is rendering into |
Mathias Agopian | d8552d7 | 2012-08-04 21:39:11 -0700 | [diff] [blame] | 209 | sp<ANativeWindow> mNativeWindow; |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 210 | sp<DisplaySurface> mDisplaySurface; |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 211 | |
Michael Lentine | 47e4540 | 2014-07-18 15:34:25 -0700 | [diff] [blame] | 212 | EGLConfig mConfig; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 213 | EGLDisplay mDisplay; |
| 214 | EGLSurface mSurface; |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 215 | int mDisplayWidth; |
| 216 | int mDisplayHeight; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 217 | #ifndef USE_HWC2 |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 218 | PixelFormat mFormat; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 219 | #endif |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 220 | uint32_t mFlags; |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 221 | mutable uint32_t mPageFlipCount; |
Andy McFadden | 8dfa92f | 2012-09-17 18:27:17 -0700 | [diff] [blame] | 222 | String8 mDisplayName; |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 223 | bool mIsSecure; |
Mathias Agopian | 03e4072 | 2012-04-26 16:11:59 -0700 | [diff] [blame] | 224 | |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 225 | /* |
| 226 | * Can only accessed from the main thread, these members |
| 227 | * don't need synchronization. |
| 228 | */ |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 229 | |
Mathias Agopian | 3b1d2b6 | 2012-07-11 13:48:17 -0700 | [diff] [blame] | 230 | // list of visible layers on that display |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 231 | Vector< sp<Layer> > mVisibleLayersSortedByZ; |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 232 | |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 233 | /* |
| 234 | * Transaction state |
| 235 | */ |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 236 | static status_t orientationToTransfrom(int orientation, |
| 237 | int w, int h, Transform* tr); |
| 238 | |
Mathias Agopian | 87baae1 | 2012-07-31 12:38:26 -0700 | [diff] [blame] | 239 | uint32_t mLayerStack; |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 240 | int mOrientation; |
Mathias Agopian | 766dc49 | 2012-10-30 18:08:06 -0700 | [diff] [blame] | 241 | // user-provided visible area of the layer stack |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 242 | Rect mViewport; |
Mathias Agopian | 766dc49 | 2012-10-30 18:08:06 -0700 | [diff] [blame] | 243 | // user-provided rectangle where mViewport gets mapped to |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 244 | Rect mFrame; |
Mathias Agopian | 766dc49 | 2012-10-30 18:08:06 -0700 | [diff] [blame] | 245 | // pre-computed scissor to apply to the display |
| 246 | Rect mScissor; |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 247 | Transform mGlobalTransform; |
Mathias Agopian | eba8c68 | 2012-09-19 23:14:45 -0700 | [diff] [blame] | 248 | bool mNeedsFiltering; |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 249 | // Current power mode |
| 250 | int mPowerMode; |
Michael Lentine | 6c9e34a | 2014-07-14 13:48:55 -0700 | [diff] [blame] | 251 | // Current active config |
| 252 | int mActiveConfig; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 253 | }; |
| 254 | |
| 255 | }; // namespace android |
| 256 | |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 257 | #endif // ANDROID_DISPLAY_DEVICE_H |