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_BASE_H |
| 18 | #define ANDROID_LAYER_BASE_H |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <sys/types.h> |
| 22 | |
Mathias Agopian | 1fed11c | 2009-06-23 18:08:22 -0700 | [diff] [blame] | 23 | #include <EGL/egl.h> |
| 24 | #include <EGL/eglext.h> |
Mathias Agopian | eda6540 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 25 | #include <GLES/gl.h> |
Mathias Agopian | 1fed11c | 2009-06-23 18:08:22 -0700 | [diff] [blame] | 26 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 27 | #include <utils/RefBase.h> |
| 28 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | #include <ui/Region.h> |
| 30 | #include <ui/Overlay.h> |
| 31 | |
Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 32 | #include <surfaceflinger/ISurfaceComposerClient.h> |
Mathias Agopian | 9cce325 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 33 | #include <private/surfaceflinger/SharedBufferStack.h> |
| 34 | #include <private/surfaceflinger/LayerState.h> |
| 35 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | #include <pixelflinger/pixelflinger.h> |
| 37 | |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 38 | #include <hardware/hwcomposer.h> |
| 39 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 | #include "Transform.h" |
| 41 | |
| 42 | namespace android { |
| 43 | |
| 44 | // --------------------------------------------------------------------------- |
| 45 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | class DisplayHardware; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | class Client; |
Mathias Agopian | 3330b20 | 2009-10-05 17:07:12 -0700 | [diff] [blame] | 48 | class GraphicBuffer; |
| 49 | class GraphicPlane; |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 50 | class LayerBaseClient; |
Mathias Agopian | 3330b20 | 2009-10-05 17:07:12 -0700 | [diff] [blame] | 51 | class SurfaceFlinger; |
Mathias Agopian | d606de6 | 2010-05-10 20:06:11 -0700 | [diff] [blame] | 52 | class Texture; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | |
| 54 | // --------------------------------------------------------------------------- |
| 55 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 56 | class LayerBase : public RefBase |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | { |
Mathias Agopian | f6679fc | 2010-08-10 18:09:09 -0700 | [diff] [blame] | 58 | static int32_t sSequence; |
| 59 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | public: |
Mathias Agopian | 1b5e102 | 2010-04-20 17:55:49 -0700 | [diff] [blame] | 61 | LayerBase(SurfaceFlinger* flinger, DisplayID display); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 62 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 63 | DisplayID dpy; |
| 64 | mutable bool contentDirty; |
| 65 | Region visibleRegionScreen; |
| 66 | Region transparentRegionScreen; |
| 67 | Region coveredRegionScreen; |
Mathias Agopian | f6679fc | 2010-08-10 18:09:09 -0700 | [diff] [blame] | 68 | int32_t sequence; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | |
| 70 | struct State { |
| 71 | uint32_t w; |
| 72 | uint32_t h; |
Mathias Agopian | 7e4a587 | 2009-09-29 22:39:22 -0700 | [diff] [blame] | 73 | uint32_t requested_w; |
| 74 | uint32_t requested_h; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 75 | uint32_t z; |
| 76 | uint8_t alpha; |
| 77 | uint8_t flags; |
| 78 | uint8_t reserved[2]; |
| 79 | int32_t sequence; // changes when visible regions can change |
| 80 | uint32_t tint; |
| 81 | Transform transform; |
| 82 | Region transparentRegion; |
| 83 | }; |
| 84 | |
Mathias Agopian | d129659 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 85 | void setName(const String8& name); |
| 86 | String8 getName() const; |
| 87 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 88 | // modify current state |
| 89 | bool setPosition(int32_t x, int32_t y); |
| 90 | bool setLayer(uint32_t z); |
| 91 | bool setSize(uint32_t w, uint32_t h); |
| 92 | bool setAlpha(uint8_t alpha); |
| 93 | bool setMatrix(const layer_state_t::matrix22_t& matrix); |
| 94 | bool setTransparentRegionHint(const Region& opaque); |
| 95 | bool setFlags(uint8_t flags, uint8_t mask); |
| 96 | |
Mathias Agopian | ba6be54 | 2009-09-29 22:32:36 -0700 | [diff] [blame] | 97 | void commitTransaction(); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 98 | bool requestTransaction(); |
| 99 | void forceVisibilityTransaction(); |
| 100 | |
| 101 | uint32_t getTransactionFlags(uint32_t flags); |
| 102 | uint32_t setTransactionFlags(uint32_t flags); |
| 103 | |
| 104 | Rect visibleBounds() const; |
| 105 | void drawRegion(const Region& reg) const; |
| 106 | |
| 107 | void invalidate(); |
Mathias Agopian | d129659 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 108 | |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 109 | virtual sp<LayerBaseClient> getLayerBaseClient() const { return 0; } |
| 110 | |
Mathias Agopian | 1b5e102 | 2010-04-20 17:55:49 -0700 | [diff] [blame] | 111 | virtual const char* getTypeId() const { return "LayerBase"; } |
Mathias Agopian | 1b5e102 | 2010-04-20 17:55:49 -0700 | [diff] [blame] | 112 | |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 113 | virtual void setGeometry(hwc_layer_t* hwcl); |
| 114 | |
| 115 | virtual void setPerFrameData(hwc_layer_t* hwcl); |
| 116 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 117 | /** |
| 118 | * draw - performs some global clipping optimizations |
| 119 | * and calls onDraw(). |
| 120 | * Typically this method is not overridden, instead implement onDraw() |
| 121 | * to perform the actual drawing. |
| 122 | */ |
| 123 | virtual void draw(const Region& clip) const; |
| 124 | |
| 125 | /** |
| 126 | * onDraw - draws the surface. |
| 127 | */ |
| 128 | virtual void onDraw(const Region& clip) const = 0; |
| 129 | |
| 130 | /** |
| 131 | * initStates - called just after construction |
| 132 | */ |
| 133 | virtual void initStates(uint32_t w, uint32_t h, uint32_t flags); |
| 134 | |
| 135 | /** |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 136 | * doTransaction - process the transaction. This is a good place to figure |
| 137 | * out which attributes of the surface have changed. |
| 138 | */ |
| 139 | virtual uint32_t doTransaction(uint32_t transactionFlags); |
| 140 | |
| 141 | /** |
| 142 | * setVisibleRegion - called to set the new visible region. This gives |
| 143 | * a chance to update the new visible region or record the fact it changed. |
| 144 | */ |
| 145 | virtual void setVisibleRegion(const Region& visibleRegion); |
| 146 | |
| 147 | /** |
| 148 | * setCoveredRegion - called when the covered region changes. The covered |
Mathias Agopian | ab02873 | 2010-03-16 16:41:46 -0700 | [diff] [blame] | 149 | * region corresponds to any area of the surface that is covered |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 150 | * (transparently or not) by another surface. |
| 151 | */ |
| 152 | virtual void setCoveredRegion(const Region& coveredRegion); |
Mathias Agopian | ab02873 | 2010-03-16 16:41:46 -0700 | [diff] [blame] | 153 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 154 | /** |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 155 | * validateVisibility - cache a bunch of things |
| 156 | */ |
| 157 | virtual void validateVisibility(const Transform& globalTransform); |
| 158 | |
| 159 | /** |
| 160 | * lockPageFlip - called each time the screen is redrawn and returns whether |
| 161 | * the visible regions need to be recomputed (this is a fairly heavy |
| 162 | * operation, so this should be set only if needed). Typically this is used |
| 163 | * to figure out if the content or size of a surface has changed. |
| 164 | */ |
| 165 | virtual void lockPageFlip(bool& recomputeVisibleRegions); |
| 166 | |
| 167 | /** |
| 168 | * unlockPageFlip - called each time the screen is redrawn. updates the |
| 169 | * final dirty region wrt the planeTransform. |
| 170 | * At this point, all visible regions, surface position and size, etc... are |
| 171 | * correct. |
| 172 | */ |
| 173 | virtual void unlockPageFlip(const Transform& planeTransform, Region& outDirtyRegion); |
| 174 | |
| 175 | /** |
| 176 | * finishPageFlip - called after all surfaces have drawn. |
| 177 | */ |
| 178 | virtual void finishPageFlip(); |
| 179 | |
| 180 | /** |
| 181 | * needsBlending - true if this surface needs blending |
| 182 | */ |
| 183 | virtual bool needsBlending() const { return false; } |
| 184 | |
| 185 | /** |
Mathias Agopian | 401c257 | 2009-09-23 19:16:27 -0700 | [diff] [blame] | 186 | * needsDithering - true if this surface needs dithering |
| 187 | */ |
| 188 | virtual bool needsDithering() const { return false; } |
| 189 | |
| 190 | /** |
Mathias Agopian | a7f6692 | 2010-05-26 22:08:52 -0700 | [diff] [blame] | 191 | * needsLinearFiltering - true if this surface needs filtering |
| 192 | */ |
| 193 | virtual bool needsFiltering() const { return mNeedsFiltering; } |
| 194 | |
| 195 | /** |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 196 | * isSecure - true if this surface is secure, that is if it prevents |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 197 | * screenshots or VNC servers. |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 198 | */ |
| 199 | virtual bool isSecure() const { return false; } |
| 200 | |
Mathias Agopian | 0b3ad46 | 2009-10-02 18:12:30 -0700 | [diff] [blame] | 201 | /** Called from the main thread, when the surface is removed from the |
| 202 | * draw list */ |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 203 | virtual status_t ditch() { return NO_ERROR; } |
| 204 | |
Mathias Agopian | 0b3ad46 | 2009-10-02 18:12:30 -0700 | [diff] [blame] | 205 | /** called with the state lock when the surface is removed from the |
| 206 | * current list */ |
| 207 | virtual void onRemoved() { }; |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 208 | |
Mathias Agopian | 1b5e102 | 2010-04-20 17:55:49 -0700 | [diff] [blame] | 209 | /** always call base class first */ |
| 210 | virtual void dump(String8& result, char* scratch, size_t size) const; |
| 211 | |
| 212 | |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 213 | enum { // flags for doTransaction() |
| 214 | eVisibleRegion = 0x00000002, |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 215 | }; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 216 | |
| 217 | |
| 218 | inline const State& drawingState() const { return mDrawingState; } |
| 219 | inline const State& currentState() const { return mCurrentState; } |
| 220 | inline State& currentState() { return mCurrentState; } |
| 221 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 222 | int32_t getOrientation() const { return mOrientation; } |
| 223 | int tx() const { return mLeft; } |
| 224 | int ty() const { return mTop; } |
| 225 | |
| 226 | protected: |
| 227 | const GraphicPlane& graphicPlane(int dpy) const; |
| 228 | GraphicPlane& graphicPlane(int dpy); |
| 229 | |
Mathias Agopian | 010fccb | 2010-05-26 22:26:12 -0700 | [diff] [blame] | 230 | void clearWithOpenGL(const Region& clip, GLclampf r, GLclampf g, |
| 231 | GLclampf b, GLclampf alpha) const; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 232 | void clearWithOpenGL(const Region& clip) const; |
Mathias Agopian | 1fed11c | 2009-06-23 18:08:22 -0700 | [diff] [blame] | 233 | void drawWithOpenGL(const Region& clip, const Texture& texture) const; |
Mathias Agopian | 1fed11c | 2009-06-23 18:08:22 -0700 | [diff] [blame] | 234 | |
Mathias Agopian | b661d66 | 2010-08-19 17:01:19 -0700 | [diff] [blame] | 235 | // these must be called from the post/drawing thread |
| 236 | void setBufferCrop(const Rect& crop); |
| 237 | void setBufferTransform(uint32_t transform); |
| 238 | |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 239 | sp<SurfaceFlinger> mFlinger; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 240 | uint32_t mFlags; |
| 241 | |
Mathias Agopian | b661d66 | 2010-08-19 17:01:19 -0700 | [diff] [blame] | 242 | // post/drawing thread |
| 243 | Rect mBufferCrop; |
| 244 | uint32_t mBufferTransform; |
| 245 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 246 | // cached during validateVisibility() |
Mathias Agopian | a7f6692 | 2010-05-26 22:08:52 -0700 | [diff] [blame] | 247 | bool mNeedsFiltering; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 248 | int32_t mOrientation; |
Mathias Agopian | 78fd501 | 2010-04-20 14:51:04 -0700 | [diff] [blame] | 249 | GLfloat mVertices[4][2]; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 250 | Rect mTransformedBounds; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 251 | int mLeft; |
| 252 | int mTop; |
| 253 | |
| 254 | // these are protected by an external lock |
| 255 | State mCurrentState; |
| 256 | State mDrawingState; |
| 257 | volatile int32_t mTransactionFlags; |
| 258 | |
| 259 | // don't change, don't need a lock |
| 260 | bool mPremultipliedAlpha; |
Mathias Agopian | d129659 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 261 | String8 mName; |
| 262 | mutable bool mDebug; |
| 263 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 264 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 265 | // atomic |
| 266 | volatile int32_t mInvalidate; |
| 267 | |
| 268 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 269 | protected: |
| 270 | virtual ~LayerBase(); |
| 271 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 272 | private: |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 273 | LayerBase(const LayerBase& rhs); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 274 | }; |
| 275 | |
| 276 | |
| 277 | // --------------------------------------------------------------------------- |
| 278 | |
| 279 | class LayerBaseClient : public LayerBase |
| 280 | { |
| 281 | public: |
| 282 | class Surface; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 283 | |
Mathias Agopian | 96f0819 | 2010-06-02 23:28:45 -0700 | [diff] [blame] | 284 | LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, |
| 285 | const sp<Client>& client); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 286 | virtual ~LayerBaseClient(); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 287 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 288 | sp<Surface> getSurface(); |
| 289 | virtual sp<Surface> createSurface() const; |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 290 | virtual sp<LayerBaseClient> getLayerBaseClient() const { |
| 291 | return const_cast<LayerBaseClient*>(this); } |
Mathias Agopian | 1b5e102 | 2010-04-20 17:55:49 -0700 | [diff] [blame] | 292 | virtual const char* getTypeId() const { return "LayerBaseClient"; } |
Mathias Agopian | 285dbde | 2010-03-01 16:09:43 -0800 | [diff] [blame] | 293 | |
Mathias Agopian | 96f0819 | 2010-06-02 23:28:45 -0700 | [diff] [blame] | 294 | uint32_t getIdentity() const { return mIdentity; } |
| 295 | |
| 296 | class Surface : public BnSurface { |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 297 | public: |
Mathias Agopian | 1c97d2e | 2009-08-19 17:46:26 -0700 | [diff] [blame] | 298 | int32_t getIdentity() const { return mIdentity; } |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 299 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 300 | protected: |
Mathias Agopian | 96f0819 | 2010-06-02 23:28:45 -0700 | [diff] [blame] | 301 | Surface(const sp<SurfaceFlinger>& flinger, int identity, |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 302 | const sp<LayerBaseClient>& owner); |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 303 | virtual ~Surface(); |
| 304 | virtual status_t onTransact(uint32_t code, const Parcel& data, |
| 305 | Parcel* reply, uint32_t flags); |
| 306 | sp<LayerBaseClient> getOwner() const; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 307 | |
| 308 | private: |
Mathias Agopian | a138f89 | 2010-05-21 17:24:35 -0700 | [diff] [blame] | 309 | virtual sp<GraphicBuffer> requestBuffer(int bufferIdx, |
| 310 | uint32_t w, uint32_t h, uint32_t format, uint32_t usage); |
Mathias Agopian | b5b7f26 | 2010-05-07 15:58:44 -0700 | [diff] [blame] | 311 | virtual status_t setBufferCount(int bufferCount); |
| 312 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 313 | virtual status_t registerBuffers(const ISurface::BufferHeap& buffers); |
| 314 | virtual void postBuffer(ssize_t offset); |
| 315 | virtual void unregisterBuffers(); |
| 316 | virtual sp<OverlayRef> createOverlay(uint32_t w, uint32_t h, |
Chih-Chung Chang | 52e7200 | 2010-01-21 17:31:06 -0800 | [diff] [blame] | 317 | int32_t format, int32_t orientation); |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 318 | |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 319 | protected: |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 320 | friend class LayerBaseClient; |
Mathias Agopian | 9a11206 | 2009-04-17 19:36:26 -0700 | [diff] [blame] | 321 | sp<SurfaceFlinger> mFlinger; |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 322 | int32_t mIdentity; |
| 323 | wp<LayerBaseClient> mOwner; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 324 | }; |
| 325 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 326 | friend class Surface; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 327 | |
Mathias Agopian | 1b5e102 | 2010-04-20 17:55:49 -0700 | [diff] [blame] | 328 | protected: |
| 329 | virtual void dump(String8& result, char* scratch, size_t size) const; |
| 330 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 331 | private: |
Mathias Agopian | 96f0819 | 2010-06-02 23:28:45 -0700 | [diff] [blame] | 332 | mutable Mutex mLock; |
| 333 | mutable wp<Surface> mClientSurface; |
Mathias Agopian | b7e930d | 2010-06-01 15:12:58 -0700 | [diff] [blame] | 334 | const wp<Client> mClientRef; |
Mathias Agopian | 2e12324 | 2009-06-23 20:06:46 -0700 | [diff] [blame] | 335 | // only read |
Mathias Agopian | 96f0819 | 2010-06-02 23:28:45 -0700 | [diff] [blame] | 336 | const uint32_t mIdentity; |
| 337 | static int32_t sIdentity; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 338 | }; |
| 339 | |
| 340 | // --------------------------------------------------------------------------- |
| 341 | |
| 342 | }; // namespace android |
| 343 | |
| 344 | #endif // ANDROID_LAYER_BASE_H |