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 | |
| 17 | #ifndef ANDROID_LAYER_H |
| 18 | #define ANDROID_LAYER_H |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <sys/types.h> |
| 22 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 23 | #include <EGL/egl.h> |
| 24 | #include <EGL/eglext.h> |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 25 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 26 | #include <utils/RefBase.h> |
| 27 | #include <utils/String8.h> |
| 28 | #include <utils/Timers.h> |
| 29 | |
| 30 | #include <ui/GraphicBuffer.h> |
| 31 | #include <ui/PixelFormat.h> |
| 32 | #include <ui/Region.h> |
| 33 | |
| 34 | #include <gui/ISurfaceComposerClient.h> |
| 35 | |
| 36 | #include <private/gui/LayerState.h> |
| 37 | |
Jamie Gennis | 82dbc74 | 2012-11-08 19:23:28 -0800 | [diff] [blame] | 38 | #include "FrameTracker.h" |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 39 | #include "Client.h" |
| 40 | #include "SurfaceFlinger.h" |
| 41 | #include "SurfaceFlingerConsumer.h" |
Mathias Agopian | a67932f | 2011-04-20 14:20:59 -0700 | [diff] [blame] | 42 | #include "SurfaceTextureLayer.h" |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | #include "Transform.h" |
| 44 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 45 | #include "DisplayHardware/HWComposer.h" |
Mathias Agopian | 6b44267 | 2013-07-09 21:24:52 -0700 | [diff] [blame] | 46 | #include "DisplayHardware/FloatRect.h" |
Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 47 | #include "RenderEngine/Mesh.h" |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 48 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 49 | namespace android { |
| 50 | |
| 51 | // --------------------------------------------------------------------------- |
| 52 | |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame] | 53 | class Client; |
Mathias Agopian | 3e25fd8 | 2013-04-22 17:52:16 +0200 | [diff] [blame] | 54 | class Colorizer; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 55 | class DisplayDevice; |
| 56 | class GraphicBuffer; |
| 57 | class SurfaceFlinger; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | |
| 59 | // --------------------------------------------------------------------------- |
| 60 | |
Andy McFadden | 882e3a3 | 2013-01-08 16:06:15 -0800 | [diff] [blame] | 61 | /* |
Andy McFadden | 882e3a3 | 2013-01-08 16:06:15 -0800 | [diff] [blame] | 62 | * A new BufferQueue and a new SurfaceFlingerConsumer are created when the |
| 63 | * Layer is first referenced. |
| 64 | * |
| 65 | * This also implements onFrameAvailable(), which notifies SurfaceFlinger |
| 66 | * that new data has arrived. |
| 67 | */ |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 68 | class Layer : public SurfaceFlingerConsumer::FrameAvailableListener { |
| 69 | static int32_t sSequence; |
| 70 | |
Mathias Agopian | d606de6 | 2010-05-10 20:06:11 -0700 | [diff] [blame] | 71 | public: |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 72 | mutable bool contentDirty; |
| 73 | // regions below are in window-manager space |
| 74 | Region visibleRegion; |
| 75 | Region coveredRegion; |
| 76 | Region visibleNonTransparentRegion; |
| 77 | int32_t sequence; |
| 78 | |
| 79 | enum { // flags for doTransaction() |
| 80 | eDontUpdateGeometryState = 0x00000001, |
| 81 | eVisibleRegion = 0x00000002, |
| 82 | }; |
| 83 | |
| 84 | struct Geometry { |
| 85 | uint32_t w; |
| 86 | uint32_t h; |
| 87 | Rect crop; |
| 88 | inline bool operator ==(const Geometry& rhs) const { |
| 89 | return (w == rhs.w && h == rhs.h && crop == rhs.crop); |
| 90 | } |
| 91 | inline bool operator !=(const Geometry& rhs) const { |
| 92 | return !operator ==(rhs); |
| 93 | } |
| 94 | }; |
| 95 | |
| 96 | struct State { |
| 97 | Geometry active; |
| 98 | Geometry requested; |
| 99 | uint32_t z; |
| 100 | uint32_t layerStack; |
| 101 | uint8_t alpha; |
| 102 | uint8_t flags; |
| 103 | uint8_t reserved[2]; |
| 104 | int32_t sequence; // changes when visible regions can change |
| 105 | Transform transform; |
Mathias Agopian | 2ca7939 | 2013-04-02 18:30:32 -0700 | [diff] [blame] | 106 | // the transparentRegion hint is a bit special, it's latched only |
| 107 | // when we receive a buffer -- this is because it's "content" |
| 108 | // dependent. |
| 109 | Region activeTransparentRegion; |
| 110 | Region requestedTransparentRegion; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 111 | }; |
| 112 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 113 | // ----------------------------------------------------------------------- |
| 114 | |
Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 115 | Layer(SurfaceFlinger* flinger, const sp<Client>& client, |
| 116 | const String8& name, uint32_t w, uint32_t h, uint32_t flags); |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 117 | |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 118 | virtual ~Layer(); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 119 | |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 120 | // the this layer's size and format |
Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 121 | status_t setBuffers(uint32_t w, uint32_t h, PixelFormat format, uint32_t flags); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 122 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 123 | // modify current state |
| 124 | bool setPosition(float x, float y); |
| 125 | bool setLayer(uint32_t z); |
| 126 | bool setSize(uint32_t w, uint32_t h); |
| 127 | bool setAlpha(uint8_t alpha); |
| 128 | bool setMatrix(const layer_state_t::matrix22_t& matrix); |
| 129 | bool setTransparentRegionHint(const Region& transparent); |
| 130 | bool setFlags(uint8_t flags, uint8_t mask); |
| 131 | bool setCrop(const Rect& crop); |
| 132 | bool setLayerStack(uint32_t layerStack); |
| 133 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 134 | uint32_t getTransactionFlags(uint32_t flags); |
| 135 | uint32_t setTransactionFlags(uint32_t flags); |
| 136 | |
Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 137 | void computeGeometry(const sp<const DisplayDevice>& hw, Mesh& mesh) const; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 138 | Rect computeBounds() const; |
| 139 | |
Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 140 | sp<IBinder> getHandle(); |
Mathias Agopian | db89edc | 2013-08-02 01:40:18 -0700 | [diff] [blame] | 141 | sp<IGraphicBufferProducer> getBufferQueue() const; |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 142 | const String8& getName() const; |
Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 143 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 144 | // ----------------------------------------------------------------------- |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 145 | // Virtuals |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 146 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 147 | virtual const char* getTypeId() const { return "Layer"; } |
| 148 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 149 | /* |
| 150 | * isOpaque - true if this surface is opaque |
| 151 | */ |
Mathias Agopian | a67932f | 2011-04-20 14:20:59 -0700 | [diff] [blame] | 152 | virtual bool isOpaque() const; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 153 | |
| 154 | /* |
| 155 | * isSecure - true if this surface is secure, that is if it prevents |
| 156 | * screenshots or VNC servers. |
| 157 | */ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 158 | virtual bool isSecure() const { return mSecure; } |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 159 | |
| 160 | /* |
| 161 | * isProtected - true if the layer may contain protected content in the |
| 162 | * GRALLOC_USAGE_PROTECTED sense. |
| 163 | */ |
Jamie Gennis | 7a4d0df | 2011-03-09 17:05:02 -0800 | [diff] [blame] | 164 | virtual bool isProtected() const; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 165 | |
| 166 | /* |
| 167 | * isVisible - true if this layer is visible, false otherwise |
| 168 | */ |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 169 | virtual bool isVisible() const; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 170 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 171 | /* |
| 172 | * isFixedSize - true if content has a fixed size |
| 173 | */ |
| 174 | virtual bool isFixedSize() const; |
Jamie Gennis | 582270d | 2011-08-17 18:19:00 -0700 | [diff] [blame] | 175 | |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 176 | protected: |
| 177 | /* |
| 178 | * onDraw - draws the surface. |
| 179 | */ |
| 180 | virtual void onDraw(const sp<const DisplayDevice>& hw, const Region& clip) const; |
| 181 | |
| 182 | public: |
| 183 | // ----------------------------------------------------------------------- |
| 184 | |
| 185 | void setGeometry(const sp<const DisplayDevice>& hw, |
| 186 | HWComposer::HWCLayerInterface& layer); |
| 187 | void setPerFrameData(const sp<const DisplayDevice>& hw, |
| 188 | HWComposer::HWCLayerInterface& layer); |
| 189 | void setAcquireFence(const sp<const DisplayDevice>& hw, |
| 190 | HWComposer::HWCLayerInterface& layer); |
| 191 | |
| 192 | /* |
| 193 | * called after page-flip |
| 194 | */ |
| 195 | void onLayerDisplayed(const sp<const DisplayDevice>& hw, |
| 196 | HWComposer::HWCLayerInterface* layer); |
| 197 | |
| 198 | /* |
| 199 | * called before composition. |
| 200 | * returns true if the layer has pending updates. |
| 201 | */ |
| 202 | bool onPreComposition(); |
| 203 | |
| 204 | /* |
| 205 | * called after composition. |
| 206 | */ |
| 207 | void onPostComposition(); |
| 208 | |
| 209 | /* |
| 210 | * draw - performs some global clipping optimizations |
| 211 | * and calls onDraw(). |
| 212 | */ |
| 213 | void draw(const sp<const DisplayDevice>& hw, const Region& clip) const; |
| 214 | void draw(const sp<const DisplayDevice>& hw); |
| 215 | |
| 216 | /* |
| 217 | * doTransaction - process the transaction. This is a good place to figure |
| 218 | * out which attributes of the surface have changed. |
| 219 | */ |
| 220 | uint32_t doTransaction(uint32_t transactionFlags); |
| 221 | |
| 222 | /* |
| 223 | * setVisibleRegion - called to set the new visible region. This gives |
| 224 | * a chance to update the new visible region or record the fact it changed. |
| 225 | */ |
| 226 | void setVisibleRegion(const Region& visibleRegion); |
| 227 | |
| 228 | /* |
| 229 | * setCoveredRegion - called when the covered region changes. The covered |
| 230 | * region corresponds to any area of the surface that is covered |
| 231 | * (transparently or not) by another surface. |
| 232 | */ |
| 233 | void setCoveredRegion(const Region& coveredRegion); |
| 234 | |
| 235 | /* |
| 236 | * setVisibleNonTransparentRegion - called when the visible and |
| 237 | * non-transparent region changes. |
| 238 | */ |
| 239 | void setVisibleNonTransparentRegion(const Region& |
| 240 | visibleNonTransparentRegion); |
| 241 | |
| 242 | /* |
| 243 | * latchBuffer - called each time the screen is redrawn and returns whether |
| 244 | * the visible regions need to be recomputed (this is a fairly heavy |
| 245 | * operation, so this should be set only if needed). Typically this is used |
| 246 | * to figure out if the content or size of a surface has changed. |
| 247 | */ |
| 248 | Region latchBuffer(bool& recomputeVisibleRegions); |
| 249 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 250 | /* |
| 251 | * called with the state lock when the surface is removed from the |
| 252 | * current list |
| 253 | */ |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 254 | void onRemoved(); |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 255 | |
| 256 | |
Andy McFadden | bf974ab | 2012-12-04 16:51:15 -0800 | [diff] [blame] | 257 | // Updates the transform hint in our SurfaceFlingerConsumer to match |
Mathias Agopian | 8430095 | 2012-11-21 16:02:13 -0800 | [diff] [blame] | 258 | // the current orientation of the display device. |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 259 | void updateTransformHint(const sp<const DisplayDevice>& hw) const; |
Andy McFadden | 6905205 | 2012-09-14 16:10:11 -0700 | [diff] [blame] | 260 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 261 | /* |
| 262 | * returns the rectangle that crops the content of the layer and scales it |
| 263 | * to the layer's size. |
| 264 | */ |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 265 | Rect getContentCrop() const; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 266 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 267 | // ----------------------------------------------------------------------- |
| 268 | |
| 269 | void clearWithOpenGL(const sp<const DisplayDevice>& hw, const Region& clip) const; |
| 270 | void setFiltering(bool filtering); |
| 271 | bool getFiltering() const; |
| 272 | |
| 273 | // only for debugging |
| 274 | inline const sp<GraphicBuffer>& getActiveBuffer() const { return mActiveBuffer; } |
| 275 | |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 276 | inline const State& getDrawingState() const { return mDrawingState; } |
| 277 | inline const State& getCurrentState() const { return mCurrentState; } |
| 278 | inline State& getCurrentState() { return mCurrentState; } |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 279 | |
| 280 | |
| 281 | /* always call base class first */ |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 282 | void dump(String8& result, Colorizer& colorizer) const; |
| 283 | void dumpStats(String8& result) const; |
| 284 | void clearStats(); |
Jamie Gennis | 6547ff4 | 2013-07-16 20:12:42 -0700 | [diff] [blame] | 285 | void logFrameStats(); |
Mathias Agopian | 1b5e102 | 2010-04-20 17:55:49 -0700 | [diff] [blame] | 286 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 287 | protected: |
| 288 | // constant |
| 289 | sp<SurfaceFlinger> mFlinger; |
| 290 | |
| 291 | virtual void onFirstRef(); |
| 292 | |
| 293 | /* |
| 294 | * Trivial class, used to ensure that mFlinger->onLayerDestroyed(mLayer) |
| 295 | * is called. |
| 296 | */ |
| 297 | class LayerCleaner { |
| 298 | sp<SurfaceFlinger> mFlinger; |
| 299 | wp<Layer> mLayer; |
| 300 | protected: |
| 301 | ~LayerCleaner(); |
| 302 | public: |
| 303 | LayerCleaner(const sp<SurfaceFlinger>& flinger, const sp<Layer>& layer); |
| 304 | }; |
| 305 | |
Mathias Agopian | 2a9fc49 | 2013-03-01 13:42:57 -0800 | [diff] [blame] | 306 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 307 | private: |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 308 | // Interface implementation for SurfaceFlingerConsumer::FrameAvailableListener |
| 309 | virtual void onFrameAvailable(); |
| 310 | |
Mathias Agopian | 1eae0ee | 2013-06-05 16:59:15 -0700 | [diff] [blame] | 311 | void commitTransaction(); |
| 312 | |
| 313 | // needsLinearFiltering - true if this surface's state requires filtering |
| 314 | bool needsFiltering(const sp<const DisplayDevice>& hw) const; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 315 | |
Mathias Agopian | 3330b20 | 2009-10-05 17:07:12 -0700 | [diff] [blame] | 316 | uint32_t getEffectiveUsage(uint32_t usage) const; |
Mathias Agopian | 6b44267 | 2013-07-09 21:24:52 -0700 | [diff] [blame] | 317 | FloatRect computeCrop(const sp<const DisplayDevice>& hw) const; |
Mathias Agopian | a67932f | 2011-04-20 14:20:59 -0700 | [diff] [blame] | 318 | bool isCropped() const; |
| 319 | static bool getOpacityForFormat(uint32_t format); |
Mathias Agopian | 0aa758d | 2009-04-22 15:23:34 -0700 | [diff] [blame] | 320 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 321 | // drawing |
| 322 | void clearWithOpenGL(const sp<const DisplayDevice>& hw, const Region& clip, |
Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 323 | float r, float g, float b, float alpha) const; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 324 | void drawWithOpenGL(const sp<const DisplayDevice>& hw, const Region& clip) const; |
| 325 | |
Igor Murashkin | a4a3149 | 2012-10-29 13:36:11 -0700 | [diff] [blame] | 326 | |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 327 | // ----------------------------------------------------------------------- |
| 328 | |
Mathias Agopian | a67932f | 2011-04-20 14:20:59 -0700 | [diff] [blame] | 329 | // constants |
Andy McFadden | bf974ab | 2012-12-04 16:51:15 -0800 | [diff] [blame] | 330 | sp<SurfaceFlingerConsumer> mSurfaceFlingerConsumer; |
Mathias Agopian | db89edc | 2013-08-02 01:40:18 -0700 | [diff] [blame] | 331 | sp<BufferQueue> mBufferQueue; |
Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 332 | uint32_t mTextureName; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 333 | bool mPremultipliedAlpha; |
| 334 | String8 mName; |
| 335 | mutable bool mDebug; |
| 336 | PixelFormat mFormat; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 337 | bool mOpaqueLayer; |
| 338 | |
| 339 | // these are protected by an external lock |
| 340 | State mCurrentState; |
| 341 | State mDrawingState; |
| 342 | volatile int32_t mTransactionFlags; |
Mathias Agopian | d606de6 | 2010-05-10 20:06:11 -0700 | [diff] [blame] | 343 | |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 344 | // thread-safe |
Mathias Agopian | a67932f | 2011-04-20 14:20:59 -0700 | [diff] [blame] | 345 | volatile int32_t mQueuedFrames; |
Jamie Gennis | 4b0eba9 | 2013-02-05 13:30:24 -0800 | [diff] [blame] | 346 | FrameTracker mFrameTracker; |
Mathias Agopian | a67932f | 2011-04-20 14:20:59 -0700 | [diff] [blame] | 347 | |
| 348 | // main thread |
| 349 | sp<GraphicBuffer> mActiveBuffer; |
Mathias Agopian | a67932f | 2011-04-20 14:20:59 -0700 | [diff] [blame] | 350 | Rect mCurrentCrop; |
| 351 | uint32_t mCurrentTransform; |
Mathias Agopian | 933389f | 2011-07-18 16:15:08 -0700 | [diff] [blame] | 352 | uint32_t mCurrentScalingMode; |
Mathias Agopian | a67932f | 2011-04-20 14:20:59 -0700 | [diff] [blame] | 353 | bool mCurrentOpacity; |
Mathias Agopian | 4d143ee | 2012-02-23 20:05:39 -0800 | [diff] [blame] | 354 | bool mRefreshPending; |
Jamie Gennis | e8696a4 | 2012-01-15 18:54:57 -0800 | [diff] [blame] | 355 | bool mFrameLatencyNeeded; |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 356 | // Whether filtering is forced on or not |
| 357 | bool mFiltering; |
| 358 | // Whether filtering is needed b/c of the drawingstate |
| 359 | bool mNeedsFiltering; |
Mathias Agopian | 5cdc899 | 2013-08-13 20:51:23 -0700 | [diff] [blame] | 360 | // The mesh used to draw the layer in GLES composition mode |
| 361 | mutable Mesh mMesh; |
Mathias Agopian | d606de6 | 2010-05-10 20:06:11 -0700 | [diff] [blame] | 362 | |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 363 | // page-flip thread (currently main thread) |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 364 | bool mSecure; // no screenshots |
Glenn Kasten | 16f0453 | 2011-01-19 15:27:27 -0800 | [diff] [blame] | 365 | bool mProtectedByApp; // application requires protected path to external sink |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 366 | |
| 367 | // protected by mLock |
| 368 | mutable Mutex mLock; |
Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 369 | // Set to true once we've returned this surface's handle |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 370 | mutable bool mHasSurface; |
| 371 | const wp<Client> mClientRef; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 372 | }; |
| 373 | |
| 374 | // --------------------------------------------------------------------------- |
| 375 | |
| 376 | }; // namespace android |
| 377 | |
| 378 | #endif // ANDROID_LAYER_H |