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
17d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian#ifndef ANDROID_DISPLAY_DEVICE_H
18d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian#define ANDROID_DISPLAY_DEVICE_H
19edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
20edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <stdlib.h>
21edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
22edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <ui/PixelFormat.h>
23edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <ui/Region.h>
24edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
25edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project#include <EGL/egl.h>
26076b1cc3a9b90aa5b381a1ed268ca0b548444c9bMathias Agopian#include <EGL/eglext.h>
27076b1cc3a9b90aa5b381a1ed268ca0b548444c9bMathias Agopian
288630320433bd15aca239522e54e711ef6372ab07Mathias Agopian#include <utils/Mutex.h>
294f4f0943489d9113c66ac22b58cfba8c21dfa879Mathias Agopian#include <utils/String8.h>
308630320433bd15aca239522e54e711ef6372ab07Mathias Agopian#include <utils/Timers.h>
318630320433bd15aca239522e54e711ef6372ab07Mathias Agopian
32f435863467ab407f2a482604beed5fa6f0144c62Mathias Agopian#include <hardware/hwcomposer_defs.h>
33f435863467ab407f2a482604beed5fa6f0144c62Mathias Agopian
341b03149f3533db04e72e088d3fdd09d0087ca594Mathias Agopian#include "Transform.h"
351f7bec634f19c123410a5155c8d282e177c01930Mathias Agopian
36d8552d796cbcb9a89711fc8f97b34838da5cbdb7Mathias Agopianstruct ANativeWindow;
37d8552d796cbcb9a89711fc8f97b34838da5cbdb7Mathias Agopian
38edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Projectnamespace android {
39edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
401495ceb88594bf3c5963ef65ee12953dc0354546Jesse Hallstruct DisplayInfo;
4199c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hallclass DisplaySurface;
429e663de4fe1dcc872373ee530c60a375624671c3Jesse Hallclass IGraphicBufferProducer;
4313127d8921356dff794250e04208c3ed60b3a3dfMathias Agopianclass Layer;
448630320433bd15aca239522e54e711ef6372ab07Mathias Agopianclass SurfaceFlinger;
45da27af9832a0170f1fc40ef3f21371c4d30d21b3Mathias Agopianclass HWComposer;
46edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
47028a7572c81f91e4039b694cde1f55fdb3e483c7Mathias Agopianclass DisplayDevice : public LightRefBase<DisplayDevice>
48edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project{
49edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Projectpublic:
5087baae104a3e4c2059990b01c393476065c558b0Mathias Agopian    // region in layer-stack space
5187baae104a3e4c2059990b01c393476065c558b0Mathias Agopian    mutable Region dirtyRegion;
5287baae104a3e4c2059990b01c393476065c558b0Mathias Agopian    // region in screen space
5387baae104a3e4c2059990b01c393476065c558b0Mathias Agopian    mutable Region swapRegion;
5487baae104a3e4c2059990b01c393476065c558b0Mathias Agopian    // region in screen space
5587baae104a3e4c2059990b01c393476065c558b0Mathias Agopian    Region undefinedRegion;
56b7a0549c983bef103ce07eb3af5905febc6e538eJesse Hall    bool lastCompositionHadVisibleLayers;
573eb38cb33e41ce40dd1094bdec850f0fca9f8a53Mathias Agopian
583ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2aMathias Agopian    enum DisplayType {
593ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2aMathias Agopian        DISPLAY_ID_INVALID = -1,
603ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2aMathias Agopian        DISPLAY_PRIMARY     = HWC_DISPLAY_PRIMARY,
613ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2aMathias Agopian        DISPLAY_EXTERNAL    = HWC_DISPLAY_EXTERNAL,
629e663de4fe1dcc872373ee530c60a375624671c3Jesse Hall        DISPLAY_VIRTUAL     = HWC_DISPLAY_VIRTUAL,
639e663de4fe1dcc872373ee530c60a375624671c3Jesse Hall        NUM_BUILTIN_DISPLAY_TYPES = HWC_NUM_PHYSICAL_DISPLAY_TYPES,
6492a979a92c34b7de609ce2b1662c73bb8a2728b9Mathias Agopian    };
6592a979a92c34b7de609ce2b1662c73bb8a2728b9Mathias Agopian
6692a979a92c34b7de609ce2b1662c73bb8a2728b9Mathias Agopian    enum {
6787baae104a3e4c2059990b01c393476065c558b0Mathias Agopian        PARTIAL_UPDATES = 0x00020000, // video driver feature
6887baae104a3e4c2059990b01c393476065c558b0Mathias Agopian        SWAP_RECTANGLE  = 0x00080000,
69edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    };
70edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
7101e29054e672301e4adbbca15b3562a59a20f267Jesse Hall    enum {
7201e29054e672301e4adbbca15b3562a59a20f267Jesse Hall        NO_LAYER_STACK = 0xFFFFFFFF,
7301e29054e672301e4adbbca15b3562a59a20f267Jesse Hall    };
7401e29054e672301e4adbbca15b3562a59a20f267Jesse Hall
750f2f5ff75b7b48ceb64270655ee6b62d09bf4d00Mathias Agopian    DisplayDevice(
76edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project            const sp<SurfaceFlinger>& flinger,
77dd3cb84cfbe8068790c6233b5829fae9c4a0ee93Jamie Gennis            DisplayType type,
78ffe1f19ca9707f84cb9fdb06209bf36cd8c2ef0aJesse Hall            int32_t hwcId,  // negative for non-HWC-composited displays
7919e872912af66c53a4350afcc333bbafaf6a2294Jesse Hall            int format,
80dd3cb84cfbe8068790c6233b5829fae9c4a0ee93Jamie Gennis            bool isSecure,
81dd3cb84cfbe8068790c6233b5829fae9c4a0ee93Jamie Gennis            const wp<IBinder>& displayToken,
8299c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall            const sp<DisplaySurface>& displaySurface,
83db89edc94bd2a78226b407f9f7261e202e7fa325Mathias Agopian            const sp<IGraphicBufferProducer>& producer,
84a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian            EGLConfig config);
85edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
86028a7572c81f91e4039b694cde1f55fdb3e483c7Mathias Agopian    ~DisplayDevice();
8792a979a92c34b7de609ce2b1662c73bb8a2728b9Mathias Agopian
8892a979a92c34b7de609ce2b1662c73bb8a2728b9Mathias Agopian    // whether this is a valid object. An invalid DisplayDevice is returned
8992a979a92c34b7de609ce2b1662c73bb8a2728b9Mathias Agopian    // when an non existing id is requested
9092a979a92c34b7de609ce2b1662c73bb8a2728b9Mathias Agopian    bool isValid() const;
9192a979a92c34b7de609ce2b1662c73bb8a2728b9Mathias Agopian
92dd3cb84cfbe8068790c6233b5829fae9c4a0ee93Jamie Gennis    // isSecure indicates whether this display can be trusted to display
93dd3cb84cfbe8068790c6233b5829fae9c4a0ee93Jamie Gennis    // secure surfaces.
94dd3cb84cfbe8068790c6233b5829fae9c4a0ee93Jamie Gennis    bool isSecure() const { return mIsSecure; }
95dd3cb84cfbe8068790c6233b5829fae9c4a0ee93Jamie Gennis
96edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    // Flip the front and back buffers if the back buffer is "dirty".  Might
97edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    // be instantaneous, might involve copying the frame buffer around.
98edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    void flip(const Region& dirty) const;
99edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
100edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    int         getWidth() const;
101edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    int         getHeight() const;
102edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    PixelFormat getFormat() const;
103edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    uint32_t    getFlags() const;
1043eb38cb33e41ce40dd1094bdec850f0fca9f8a53Mathias Agopian
105a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian    EGLSurface  getEGLSurface() const;
1063b1d2b6b2bbfb5df46b1059ec52360974e6f1428Mathias Agopian
10713127d8921356dff794250e04208c3ed60b3a3dfMathias Agopian    void                    setVisibleLayersSortedByZ(const Vector< sp<Layer> >& layers);
10813127d8921356dff794250e04208c3ed60b3a3dfMathias Agopian    const Vector< sp<Layer> >& getVisibleLayersSortedByZ() const;
1093b1d2b6b2bbfb5df46b1059ec52360974e6f1428Mathias Agopian    bool                    getSecureLayerVisible() const;
110cd60f99aba9e750700a967db30b74a29145739cfMathias Agopian    Region                  getDirtyRegion(bool repaintEverything) const;
1113b1d2b6b2bbfb5df46b1059ec52360974e6f1428Mathias Agopian
11228947d7fbf9f486539322e8e12dd057568e180c2Mathias Agopian    void                    setLayerStack(uint32_t stack);
11347e45405d1533aa73307014f7bf371e118695cf3Michael Lentine    void                    setDisplaySize(const int newWidth, const int newHeight);
11400e8c7a88a5b9c4104a71013a713acd3e4d3b77bMathias Agopian    void                    setProjection(int orientation, const Rect& viewport, const Rect& frame);
11528947d7fbf9f486539322e8e12dd057568e180c2Mathias Agopian
1161b03149f3533db04e72e088d3fdd09d0087ca594Mathias Agopian    int                     getOrientation() const { return mOrientation; }
117c1c05de415854eb7a13a16b7e22a22de8515123aMathias Agopian    uint32_t                getOrientationTransform() const;
1181b03149f3533db04e72e088d3fdd09d0087ca594Mathias Agopian    const Transform&        getTransform() const { return mGlobalTransform; }
119f5f714aa188884098aaecbe39d0bc61b40311c0dMathias Agopian    const Rect              getViewport() const { return mViewport; }
120f5f714aa188884098aaecbe39d0bc61b40311c0dMathias Agopian    const Rect              getFrame() const { return mFrame; }
121766dc49c17dda977bf7b93a5fd8da41c0b737611Mathias Agopian    const Rect&             getScissor() const { return mScissor; }
122eba8c688f633f3f3f1b75c2bc64faf799dd2b5f2Mathias Agopian    bool                    needsFiltering() const { return mNeedsFiltering; }
123da8d0a5c0cf9d41915d3b106cad4aaec3e767c11Mathias Agopian
12487baae104a3e4c2059990b01c393476065c558b0Mathias Agopian    uint32_t                getLayerStack() const { return mLayerStack; }
1253ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2aMathias Agopian    int32_t                 getDisplayType() const { return mType; }
126e60b0687c8d49871d0c8786cabe6851f7a7783b5Mathias Agopian    int32_t                 getHwcDisplayId() const { return mHwcDisplayId; }
1273ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2aMathias Agopian    const wp<IBinder>&      getDisplayToken() const { return mDisplayToken; }
12887baae104a3e4c2059990b01c393476065c558b0Mathias Agopian
1297143316af216fa92c31a60d4407b707637382da1Dan Stoza    // We pass in mustRecompose so we can keep VirtualDisplaySurface's state
1307143316af216fa92c31a60d4407b707637382da1Dan Stoza    // machine happy without actually queueing a buffer if nothing has changed
1317143316af216fa92c31a60d4407b707637382da1Dan Stoza    status_t beginFrame(bool mustRecompose) const;
13238efe86d9459cf5c96a24a34cc5cbf31fdba7e19Jesse Hall    status_t prepareFrame(const HWComposer& hwc) const;
13338efe86d9459cf5c96a24a34cc5cbf31fdba7e19Jesse Hall
134da27af9832a0170f1fc40ef3f21371c4d30d21b3Mathias Agopian    void swapBuffers(HWComposer& hwc) const;
13574faca212e2675aa55a30235c77cb6403471a4b9Mathias Agopian    status_t compositionComplete() const;
13601e29054e672301e4adbbca15b3562a59a20f267Jesse Hall
137da27af9832a0170f1fc40ef3f21371c4d30d21b3Mathias Agopian    // called after h/w composer has completed its set() call
138da27af9832a0170f1fc40ef3f21371c4d30d21b3Mathias Agopian    void onSwapBuffersCompleted(HWComposer& hwc) const;
139da27af9832a0170f1fc40ef3f21371c4d30d21b3Mathias Agopian
1409c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian    Rect getBounds() const {
1411b03149f3533db04e72e088d3fdd09d0087ca594Mathias Agopian        return Rect(mDisplayWidth, mDisplayHeight);
142edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    }
1439c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian    inline Rect bounds() const { return getBounds(); }
144edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
1459e2463e71796964cfaa06bf09a880875ac3537bcMathias Agopian    void setDisplayName(const String8& displayName);
1468dfa92fef9759a881e96ee58d59875d35023aab9Andy McFadden    const String8& getDisplayName() const { return mDisplayName; }
1478dfa92fef9759a881e96ee58d59875d35023aab9Andy McFadden
148875d8e1323536e16dcfc90c9674d7ad32116a69aMathias Agopian    EGLBoolean makeCurrent(EGLDisplay dpy, EGLContext ctx) const;
149875d8e1323536e16dcfc90c9674d7ad32116a69aMathias Agopian    void setViewportAndProjection() const;
150bae92d0d605e99a14731add4f11b72413b2835e5Mathias Agopian
151d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian    /* ------------------------------------------------------------------------
1522c9b11f0291210c9b9513a1a0cce6afebd361b3bPrashant Malani     * Display power mode management.
153d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian     */
1542c9b11f0291210c9b9513a1a0cce6afebd361b3bPrashant Malani    int getPowerMode() const;
1552c9b11f0291210c9b9513a1a0cce6afebd361b3bPrashant Malani    void setPowerMode(int mode);
1562c9b11f0291210c9b9513a1a0cce6afebd361b3bPrashant Malani    bool isDisplayOn() const;
157d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian
1586c9e34a98a63033b80bd1c24c7aa1304f912f10aMichael Lentine    /* ------------------------------------------------------------------------
1596c9e34a98a63033b80bd1c24c7aa1304f912f10aMichael Lentine     * Display active config management.
1606c9e34a98a63033b80bd1c24c7aa1304f912f10aMichael Lentine     */
1616c9e34a98a63033b80bd1c24c7aa1304f912f10aMichael Lentine    int getActiveConfig() const;
1626c9e34a98a63033b80bd1c24c7aa1304f912f10aMichael Lentine    void setActiveConfig(int mode);
1636c9e34a98a63033b80bd1c24c7aa1304f912f10aMichael Lentine
16402d86567d95b99e1142941ed7ec23a4465822813Jesse Hall    // release HWC resources (if any) for removable displays
16502d86567d95b99e1142941ed7ec23a4465822813Jesse Hall    void disconnect(HWComposer& hwc);
16602d86567d95b99e1142941ed7ec23a4465822813Jesse Hall
167d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian    /* ------------------------------------------------------------------------
168d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian     * Debugging
169d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian     */
170d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian    uint32_t getPageFlipCount() const;
17174d211ae26a0257c6075a823812e40b55aa1e653Mathias Agopian    void dump(String8& result) const;
172d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian
173edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Projectprivate:
174a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian    /*
175a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian     *  Constants, set during initialization
176a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian     */
177c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian    sp<SurfaceFlinger> mFlinger;
1783ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2aMathias Agopian    DisplayType mType;
179e60b0687c8d49871d0c8786cabe6851f7a7783b5Mathias Agopian    int32_t mHwcDisplayId;
1803ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2aMathias Agopian    wp<IBinder> mDisplayToken;
181d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian
182a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian    // ANativeWindow this display is rendering into
183d8552d796cbcb9a89711fc8f97b34838da5cbdb7Mathias Agopian    sp<ANativeWindow> mNativeWindow;
18499c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    sp<DisplaySurface> mDisplaySurface;
185a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian
18647e45405d1533aa73307014f7bf371e118695cf3Michael Lentine    EGLConfig       mConfig;
187edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    EGLDisplay      mDisplay;
188edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    EGLSurface      mSurface;
1891b03149f3533db04e72e088d3fdd09d0087ca594Mathias Agopian    int             mDisplayWidth;
1901b03149f3533db04e72e088d3fdd09d0087ca594Mathias Agopian    int             mDisplayHeight;
191edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    PixelFormat     mFormat;
192edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project    uint32_t        mFlags;
193076b1cc3a9b90aa5b381a1ed268ca0b548444c9bMathias Agopian    mutable uint32_t mPageFlipCount;
1948dfa92fef9759a881e96ee58d59875d35023aab9Andy McFadden    String8         mDisplayName;
195dd3cb84cfbe8068790c6233b5829fae9c4a0ee93Jamie Gennis    bool            mIsSecure;
19603e407270c7ad76632f982c886d0776bed9e9b4cMathias Agopian
197a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian    /*
198a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian     * Can only accessed from the main thread, these members
199a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian     * don't need synchronization.
200a49126087b4494f4ef50873f3a3f6727265f6621Mathias Agopian     */
201d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian
2023b1d2b6b2bbfb5df46b1059ec52360974e6f1428Mathias Agopian    // list of visible layers on that display
20313127d8921356dff794250e04208c3ed60b3a3dfMathias Agopian    Vector< sp<Layer> > mVisibleLayersSortedByZ;
204d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian
2053b1d2b6b2bbfb5df46b1059ec52360974e6f1428Mathias Agopian    // Whether we have a visible secure layer on this display
2063b1d2b6b2bbfb5df46b1059ec52360974e6f1428Mathias Agopian    bool mSecureLayerVisible;
2073b1d2b6b2bbfb5df46b1059ec52360974e6f1428Mathias Agopian
208a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
209d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian    /*
210d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian     * Transaction state
211d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian     */
212da8d0a5c0cf9d41915d3b106cad4aaec3e767c11Mathias Agopian    static status_t orientationToTransfrom(int orientation,
213da8d0a5c0cf9d41915d3b106cad4aaec3e767c11Mathias Agopian            int w, int h, Transform* tr);
214da8d0a5c0cf9d41915d3b106cad4aaec3e767c11Mathias Agopian
21587baae104a3e4c2059990b01c393476065c558b0Mathias Agopian    uint32_t mLayerStack;
216da8d0a5c0cf9d41915d3b106cad4aaec3e767c11Mathias Agopian    int mOrientation;
217766dc49c17dda977bf7b93a5fd8da41c0b737611Mathias Agopian    // user-provided visible area of the layer stack
218da8d0a5c0cf9d41915d3b106cad4aaec3e767c11Mathias Agopian    Rect mViewport;
219766dc49c17dda977bf7b93a5fd8da41c0b737611Mathias Agopian    // user-provided rectangle where mViewport gets mapped to
220da8d0a5c0cf9d41915d3b106cad4aaec3e767c11Mathias Agopian    Rect mFrame;
221766dc49c17dda977bf7b93a5fd8da41c0b737611Mathias Agopian    // pre-computed scissor to apply to the display
222766dc49c17dda977bf7b93a5fd8da41c0b737611Mathias Agopian    Rect mScissor;
223da8d0a5c0cf9d41915d3b106cad4aaec3e767c11Mathias Agopian    Transform mGlobalTransform;
224eba8c688f633f3f3f1b75c2bc64faf799dd2b5f2Mathias Agopian    bool mNeedsFiltering;
2252c9b11f0291210c9b9513a1a0cce6afebd361b3bPrashant Malani    // Current power mode
2262c9b11f0291210c9b9513a1a0cce6afebd361b3bPrashant Malani    int mPowerMode;
2276c9e34a98a63033b80bd1c24c7aa1304f912f10aMichael Lentine    // Current active config
2286c9e34a98a63033b80bd1c24c7aa1304f912f10aMichael Lentine    int mActiveConfig;
229edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project};
230edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
231edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project}; // namespace android
232edbf3b6af777b721cd2a1ef461947e51e88241e1The Android Open Source Project
233d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3Mathias Agopian#endif // ANDROID_DISPLAY_DEVICE_H
234