SurfaceFlinger.h revision c666cae2d5995097ec49a87e375e2afdd92802b7
1edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project/*
2edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * Copyright (C) 2007 The Android Open Source Project
3edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project *
4edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License");
5edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * you may not use this file except in compliance with the License.
6edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * You may obtain a copy of the License at
7edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project *
8edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project *      http://www.apache.org/licenses/LICENSE-2.0
9edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project *
10edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * Unless required by applicable law or agreed to in writing, software
11edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS,
12edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * See the License for the specific language governing permissions and
14edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project * limitations under the License.
15edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project */
16edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
17edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#ifndef ANDROID_SURFACE_FLINGER_H
18edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#define ANDROID_SURFACE_FLINGER_H
19edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
20edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <stdint.h>
21edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <sys/types.h>
22edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
23921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian#include <EGL/egl.h>
24921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian#include <GLES/gl.h>
25921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
2699ed22412db547c59d3da08114d9d5a586442b30Glenn Kasten#include <cutils/compiler.h>
2799ed22412db547c59d3da08114d9d5a586442b30Glenn Kasten
28edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <utils/Atomic.h>
29edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <utils/Errors.h>
3099b49840d309727678b77403d6cc9f920111623fMathias Agopian#include <utils/KeyedVector.h>
31076b1cc3a9b90aa5b381a1ed268ca0b548444c9bMathias Agopian#include <utils/RefBase.h>
3299b49840d309727678b77403d6cc9f920111623fMathias Agopian#include <utils/SortedVector.h>
3399b49840d309727678b77403d6cc9f920111623fMathias Agopian#include <utils/threads.h>
34edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
35a1e6bc864fb821c1b470b7aad9b75c441f54eeb4Mathias Agopian#include <binder/BinderService.h>
3699b49840d309727678b77403d6cc9f920111623fMathias Agopian#include <binder/IMemory.h>
37375f56363a8737119ce2222dcfaacbe1cf733fc0Mathias Agopian
38edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <ui/PixelFormat.h>
39921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
4090ac799241f077a7b7e6c1875fd933864c8dd2a7Mathias Agopian#include <gui/IGraphicBufferAlloc.h>
4190ac799241f077a7b7e6c1875fd933864c8dd2a7Mathias Agopian#include <gui/ISurfaceComposer.h>
4290ac799241f077a7b7e6c1875fd933864c8dd2a7Mathias Agopian#include <gui/ISurfaceComposerClient.h>
43edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
448630320433bd15aca239522e54e711ef6372ab07Mathias Agopian#include <hardware/hwcomposer_defs.h>
458630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
46921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian#include <private/gui/LayerState.h>
47edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
48921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian#include "Barrier.h"
49f1d8e87b09abf963cd5b6a026194c1940fadb7b4Mathias Agopian#include "MessageQueue.h"
50f1d8e87b09abf963cd5b6a026194c1940fadb7b4Mathias Agopian
518630320433bd15aca239522e54e711ef6372ab07Mathias Agopian#include "DisplayHardware/HWComposer.h"
528630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
53edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Projectnamespace android {
54edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
55edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project// ---------------------------------------------------------------------------
56edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
57edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Projectclass Client;
58d0566bc26fcf6ca396118701fa11900b627f2c09Mathias Agopianclass DisplayEventConnection;
59921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopianclass DisplayHardware;
60d0566bc26fcf6ca396118701fa11900b627f2c09Mathias Agopianclass EventThread;
61edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Projectclass Layer;
62921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopianclass LayerBase;
63921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopianclass LayerBaseClient;
64b7e930db175c192464cebdeb49eb56cf6dd60114Mathias Agopianclass LayerDim;
65118d0245ee0a3b107055782aa8b555404b6f0280Mathias Agopianclass LayerScreenshot;
66921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopianclass SurfaceTextureClient;
67edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
68edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project// ---------------------------------------------------------------------------
69edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
70921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopianclass GraphicBufferAlloc : public BnGraphicBufferAlloc {
719a78c90cd46b2a3bd637b056873149d3b94384b4Jamie Gennispublic:
729a78c90cd46b2a3bd637b056873149d3b94384b4Jamie Gennis    GraphicBufferAlloc();
739a78c90cd46b2a3bd637b056873149d3b94384b4Jamie Gennis    virtual ~GraphicBufferAlloc();
749a78c90cd46b2a3bd637b056873149d3b94384b4Jamie Gennis    virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
75d9e8c64c3dce1612eb948a5c16ba4ff62202b423Mathias Agopian        PixelFormat format, uint32_t usage, status_t* error);
769a78c90cd46b2a3bd637b056873149d3b94384b4Jamie Gennis};
779a78c90cd46b2a3bd637b056873149d3b94384b4Jamie Gennis
78edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project// ---------------------------------------------------------------------------
79edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
80edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Projectenum {
81921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    eTransactionNeeded = 0x01, eTraversalNeeded = 0x02
82edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project};
83edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
84921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopianclass SurfaceFlinger : public BinderService<SurfaceFlinger>,
85921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian                       public BnSurfaceComposer,
86921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian                       private IBinder::DeathRecipient,
878630320433bd15aca239522e54e711ef6372ab07Mathias Agopian                       private Thread,
888630320433bd15aca239522e54e711ef6372ab07Mathias Agopian                       private HWComposer::EventHandler
89edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project{
90edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Projectpublic:
91921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    static char const* getServiceName() {
92921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        return "SurfaceFlinger";
93921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    }
94118d0245ee0a3b107055782aa8b555404b6f0280Mathias Agopian
95921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    SurfaceFlinger();
9699ce5cdeb383216dee95af4d90e47406b0948ea1Mathias Agopian
978630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    enum {
988630320433bd15aca239522e54e711ef6372ab07Mathias Agopian        EVENT_VSYNC = HWC_EVENT_VSYNC
998630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    };
1008630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
101921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // post an asynchronous message to the main thread
102921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t postMessageAsync(const sp<MessageBase>& msg, nsecs_t reltime = 0,
103921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t flags = 0);
104118d0245ee0a3b107055782aa8b555404b6f0280Mathias Agopian
105921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // post a synchronous message to the main thread
106921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t postMessageSync(const sp<MessageBase>& msg, nsecs_t reltime = 0,
107921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t flags = 0);
108118d0245ee0a3b107055782aa8b555404b6f0280Mathias Agopian
109921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // force full composition on all displays
110921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void repaintEverything();
111b7e930db175c192464cebdeb49eb56cf6dd60114Mathias Agopian
112921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // renders content on given display to a texture. thread-safe version.
113921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t renderScreenToTexture(DisplayID dpy, GLuint* textureName,
114921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        GLfloat* uOut, GLfloat* vOut);
1159575f60722f7a4f54384fe0be6938a8de48dc23aJamie Gennis
116921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // renders content on given display to a texture, w/o acquiring main lock
117921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t renderScreenToTextureLocked(DisplayID dpy, GLuint* textureName,
118921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        GLfloat* uOut, GLfloat* vOut);
119a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian
120921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // returns the default Display
121921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    const DisplayHardware& getDefaultDisplayHardware() const {
122921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        return getDisplayHardware(0);
123921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    }
124118d0245ee0a3b107055782aa8b555404b6f0280Mathias Agopian
1258630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    // utility function to delete a texture on the main thread
1268630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    void deleteTextureAsync(GLuint texture);
1278630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
1288630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
1298630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    // enable/disable h/w composer event
1308630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    // TODO: this should be made accessible only to EventThread
1318630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    void eventControl(int event, int enabled);
1328630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
133921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // called on the main thread by MessageQueue when an internal message
134921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // is received
135921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // TODO: this should be made accessible only to MessageQueue
136921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void onMessageReceived(int32_t what);
137118d0245ee0a3b107055782aa8b555404b6f0280Mathias Agopian
1381f339ff3875afad128a8e16ee6395c5fad295826Mathias Agopianprivate:
13996f0819f81293076e652792794a961543e6750d7Mathias Agopian    friend class Client;
140d0566bc26fcf6ca396118701fa11900b627f2c09Mathias Agopian    friend class DisplayEventConnection;
141edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    friend class LayerBase;
142edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    friend class LayerBaseClient;
143edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    friend class Layer;
144edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
145921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // We're reference counted, never destroy SurfaceFlinger directly
146921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual ~SurfaceFlinger();
147edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
148921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
149921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Internal data structures
150921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
151118d0245ee0a3b107055782aa8b555404b6f0280Mathias Agopian
152921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    class LayerVector : public SortedVector<sp<LayerBase> > {
153edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    public:
154921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        LayerVector();
155921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        LayerVector(const LayerVector& rhs);
156921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        virtual int do_compare(const void* lhs, const void* rhs) const;
157edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    };
158edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
159edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    struct State {
160921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        State();
161921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        LayerVector layersSortedByZ;
162921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint8_t orientation;
163921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint8_t orientationFlags;
164edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    };
165edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
166921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
167921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * IBinder interface
168921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
169921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual status_t onTransact(uint32_t code, const Parcel& data,
170921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        Parcel* reply, uint32_t flags);
171921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual status_t dump(int fd, const Vector<String16>& args);
172edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
173921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
174921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * ISurfaceComposer interface
175921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
176921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual sp<ISurfaceComposerClient> createConnection();
177921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc();
178921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual void bootFinished();
179921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual void setTransactionState(const Vector<ComposerState>& state,
1808b33f032327f8de0dcc0e6d0d43ed80f834b51f6Mathias Agopian            const Vector<DisplayState>& displays, uint32_t flags);
181921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual bool authenticateSurfaceTexture(
182921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        const sp<ISurfaceTexture>& surface) const;
183921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual sp<IDisplayEventConnection> createDisplayEventConnection();
184921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual status_t captureScreen(DisplayID dpy, sp<IMemoryHeap>* heap,
185921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t* width, uint32_t* height, PixelFormat* format,
186921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ,
187921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t maxLayerZ);
188921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual status_t turnElectronBeamOff(int32_t mode);
189921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual status_t turnElectronBeamOn(int32_t mode);
190921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // called when screen needs to turn off
191921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual void blank();
192921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // called when screen is turning back on
193921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual void unblank();
194c666cae2d5995097ec49a87e375e2afdd92802b7Mathias Agopian    virtual status_t getDisplayInfo(DisplayID dpy, DisplayInfo* info);
195921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual void connectDisplay(const sp<ISurfaceTexture> display);
1961b03149f3533db04e72e088d3fdd09d0087ca594Mathias Agopian
197921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
198921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * DeathRecipient interface
199921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
200921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual void binderDied(const wp<IBinder>& who);
20199ce5cdeb383216dee95af4d90e47406b0948ea1Mathias Agopian
202921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
203921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Thread interface
204921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
205921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual bool threadLoop();
206921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual status_t readyToRun();
207921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    virtual void onFirstRef();
208921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
209921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
2108630320433bd15aca239522e54e711ef6372ab07Mathias Agopian     * HWComposer::EventHandler interface
2118630320433bd15aca239522e54e711ef6372ab07Mathias Agopian     */
2128630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    virtual void onVSyncReceived(int dpy, nsecs_t timestamp);
2138630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
2148630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    /* ------------------------------------------------------------------------
215921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Message handling
216921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
217921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void waitForEvent();
218921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void signalTransaction();
219921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void signalLayerUpdate();
220921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void signalRefresh();
221921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
222921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // called on the main thread in response to screenReleased()
223921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void onScreenReleased();
224921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // called on the main thread in response to screenAcquired()
225921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void onScreenAcquired();
226921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
227921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void handleMessageTransaction();
228921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void handleMessageInvalidate();
229921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void handleMessageRefresh();
230921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
231921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region handleTransaction(uint32_t transactionFlags);
232921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region handleTransactionLocked(uint32_t transactionFlags);
233921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
234921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* handlePageFilp: this is were we latch a new buffer
235921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * if available and compute the dirty region.
236921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * The return value is the dirty region expressed in the
237921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * window manager's coordinate space (or the layer's state
238921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * space, which is the same thing), in particular the dirty
239921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * region is independent from a specific display's orientation.
240921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
241921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region handlePageFlip();
242921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
243921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void handleRefresh();
244921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void handleWorkList(const DisplayHardware& hw);
245921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void handleRepaint(const DisplayHardware& hw);
246921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
247921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
248921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Transactions
249921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
250921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    uint32_t getTransactionFlags(uint32_t flags);
251921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    uint32_t peekTransactionFlags(uint32_t flags);
252921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    uint32_t setTransactionFlags(uint32_t flags);
253921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void commitTransaction();
254921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    uint32_t setClientStateLocked(const sp<Client>& client,
255921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        const layer_state_t& s);
256921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
257921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
258921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Layer management
259921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
260921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    sp<ISurface> createLayer(ISurfaceComposerClient::surface_data_t* params,
261921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        const String8& name, const sp<Client>& client, DisplayID display,
262921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t w, uint32_t h, PixelFormat format, uint32_t flags);
263921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
264921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    sp<Layer> createNormalLayer(const sp<Client>& client, DisplayID display,
265921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t w, uint32_t h, uint32_t flags, PixelFormat& format);
266921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
267921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    sp<LayerDim> createDimLayer(const sp<Client>& client, DisplayID display,
268921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t w, uint32_t h, uint32_t flags);
269921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
270921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    sp<LayerScreenshot> createScreenshotLayer(const sp<Client>& client,
271921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        DisplayID display, uint32_t w, uint32_t h, uint32_t flags);
272921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
273921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // called in response to the window-manager calling
274921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // ISurfaceComposerClient::destroySurface()
275921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // The specified layer is first placed in a purgatory list
276921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // until all references from the client are released.
277921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t onLayerRemoved(const sp<Client>& client, SurfaceID sid);
278921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
279921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // called when all clients have released all their references to
280921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // this layer meaning it is entirely safe to destroy all
281921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // resources associated to this layer.
282921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t onLayerDestroyed(const wp<LayerBaseClient>& layer);
283921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
284921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // remove a layer from SurfaceFlinger immediately
285921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t removeLayer(const sp<LayerBase>& layer);
286edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
287921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // add a layer to SurfaceFlinger
288921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    ssize_t addClientLayer(const sp<Client>& client,
289921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        const sp<LayerBaseClient>& lbc);
290921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
291921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t removeLayer_l(const sp<LayerBase>& layer);
292921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t purgatorizeLayer_l(const sp<LayerBase>& layer);
293921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
294921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
295921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Boot animation, on/off animations and screen capture
296921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
297921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
298921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void startBootAnim();
299921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
300921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t captureScreenImplLocked(DisplayID dpy, sp<IMemoryHeap>* heap,
301921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t* width, uint32_t* height, PixelFormat* format,
302921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ,
303921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        uint32_t maxLayerZ);
304921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
305921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t turnElectronBeamOffImplLocked(int32_t mode);
306921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t turnElectronBeamOnImplLocked(int32_t mode);
307921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t electronBeamOffAnimationImplLocked();
308921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    status_t electronBeamOnAnimationImplLocked();
309921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
310921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
311921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * EGL
312921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
313921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    static status_t selectConfigForPixelFormat(EGLDisplay dpy,
314921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        EGLint const* attrs, PixelFormat format, EGLConfig* outConfig);
315921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    static EGLConfig selectEGLConfig(EGLDisplay disp, EGLint visualId);
316921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    static EGLContext createGLContext(EGLDisplay disp, EGLConfig config);
317921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void initializeGL(EGLDisplay display, EGLSurface surface);
318921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    uint32_t getMaxTextureSize() const;
319921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    uint32_t getMaxViewportDims() const;
320921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
321921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
322921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Display management
323921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
324921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    const DisplayHardware& getDisplayHardware(DisplayID dpy) const {
325921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        return *mDisplayHardwares[dpy];
326921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    }
327921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
328921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
3298630320433bd15aca239522e54e711ef6372ab07Mathias Agopian     * H/W composer
3308630320433bd15aca239522e54e711ef6372ab07Mathias Agopian     */
3318630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
3328630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    HWComposer& getHwComposer() const { return *mHwc; }
3338630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
3348630320433bd15aca239522e54e711ef6372ab07Mathias Agopian        /* ------------------------------------------------------------------------
335921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Compositing
336921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
337921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void invalidateHwcGeometry();
338921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void computeVisibleRegions(const LayerVector& currentLayers,
339921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        Region& dirtyRegion, Region& wormholeRegion);
340921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void postFramebuffer();
341921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void setupHardwareComposer(const DisplayHardware& hw);
342921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void composeSurfaces(const DisplayHardware& hw, const Region& dirty);
343921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void setInvalidateRegion(const Region& reg);
344921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region getAndClearInvalidateRegion();
345921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void drawWormhole() const;
346921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    GLuint getProtectedTexName() const {
347921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        return mProtectedTexName;
348921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    }
349921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
350921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
351921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Debugging & dumpsys
352921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
353921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void debugFlashRegions(const DisplayHardware& hw);
354921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void listLayersLocked(const Vector<String16>& args, size_t& index,
355921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        String8& result, char* buffer, size_t SIZE) const;
356921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void dumpStatsLocked(const Vector<String16>& args, size_t& index,
357921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        String8& result, char* buffer, size_t SIZE) const;
358921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void clearStatsLocked(const Vector<String16>& args, size_t& index,
359921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian        String8& result, char* buffer, size_t SIZE) const;
360921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    void dumpAllLocked(String8& result, char* buffer, size_t SIZE) const;
361921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
362921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
363921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Attributes
364921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
365921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
366921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // access must be protected by mStateLock
367921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    mutable Mutex mStateLock;
368921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    State mCurrentState;
369921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    volatile int32_t mTransactionFlags;
370921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Condition mTransactionCV;
371921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    SortedVector<sp<LayerBase> > mLayerPurgatory;
372921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    bool mTransationPending;
373921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Vector<sp<LayerBase> > mLayersPendingRemoval;
374921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
375921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // protected by mStateLock (but we could use another lock)
376921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    DisplayHardware* mDisplayHardwares[1];
377921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    bool mLayersRemoved;
378921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
379921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // access must be protected by mInvalidateLock
380921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    mutable Mutex mInvalidateLock;
381921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region mInvalidateRegion;
382921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
383921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // constant members (no synchronization needed for access)
3848630320433bd15aca239522e54e711ef6372ab07Mathias Agopian    HWComposer* mHwc;
385921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    GLuint mWormholeTexName;
386921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    GLuint mProtectedTexName;
387921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    nsecs_t mBootTime;
388921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    sp<EventThread> mEventThread;
389921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    GLint mMaxViewportDims[2];
390921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    GLint mMaxTextureSize;
391921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    EGLContext mEGLContext;
392921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    EGLConfig mEGLConfig;
393921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
394921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // Can only accessed from the main thread, these members
395921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // don't need synchronization
396921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    State mDrawingState;
397921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region mDirtyRegion;
398921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region mDirtyRegionRemovedLayer;
399921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region mSwapRegion;
400921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Region mWormholeRegion;
401921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    bool mVisibleRegionsDirty;
402921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    bool mHwWorkListDirty;
403921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    int32_t mElectronBeamAnimationMode;
404921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
405921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // don't use a lock for these, we don't care
406921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    int mDebugRegion;
407921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    int mDebugDDMS;
408921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    int mDebugDisableHWC;
409921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    int mDebugDisableTransformHint;
410921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    volatile nsecs_t mDebugInSwapBuffers;
411921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    nsecs_t mLastSwapBufferTime;
412921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    volatile nsecs_t mDebugInTransaction;
413921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    nsecs_t mLastTransactionTime;
414921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    bool mBootFinished;
415921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
416921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // these are thread safe
417921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    mutable MessageQueue mEventQueue;
418921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    mutable Barrier mReadyToRunBarrier;
419921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
420921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    // protected by mDestroyedLayerLock;
421921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    mutable Mutex mDestroyedLayerLock;
422921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    Vector<LayerBase const *> mDestroyedLayers;
423921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
424921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    /* ------------------------------------------------------------------------
425921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     * Feature prototyping
426921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian     */
427921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian
428921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    EGLSurface getExternalDisplaySurface() const;
429921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    sp<SurfaceTextureClient> mExternalDisplayNativeWindow;
430921e6ac4b7610a178285898d191eb0e3afe906c0Mathias Agopian    EGLSurface mExternalDisplaySurface;
431edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project};
432edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
433edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project// ---------------------------------------------------------------------------
434edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project}; // namespace android
435edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
436edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#endif // ANDROID_SURFACE_FLINGER_H
437