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