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