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