| 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 |  | 
| Mathias Agopian | 90ac799 | 2012-02-25 18:48:35 -0800 | [diff] [blame] | 17 | #ifndef ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H | 
 | 18 | #define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 19 |  | 
 | 20 | #include <stdint.h> | 
 | 21 | #include <sys/types.h> | 
 | 22 |  | 
 | 23 | #include <utils/Errors.h> | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | #include <utils/RefBase.h> | 
 | 25 |  | 
| Mathias Agopian | 9cce325 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 26 | #include <binder/IInterface.h> | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 |  | 
| Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 28 | #include <ui/FrameStats.h> | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | #include <ui/PixelFormat.h> | 
| Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 30 |  | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | namespace android { | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | // ---------------------------------------------------------------------------- | 
 | 33 |  | 
| Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 34 | class IGraphicBufferProducer; | 
 | 35 |  | 
| Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 36 | class ISurfaceComposerClient : public IInterface | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | { | 
| Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 38 | public: | 
| Colin Cross | 17576de | 2016-09-26 13:07:06 -0700 | [diff] [blame] | 39 |     DECLARE_META_INTERFACE(SurfaceComposerClient) | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 |  | 
| Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 41 |     // flags for createSurface() | 
 | 42 |     enum { // (keep in sync with Surface.java) | 
 | 43 |         eHidden             = 0x00000004, | 
 | 44 |         eDestroyBackbuffer  = 0x00000020, | 
 | 45 |         eSecure             = 0x00000080, | 
 | 46 |         eNonPremultiplied   = 0x00000100, | 
 | 47 |         eOpaque             = 0x00000400, | 
 | 48 |         eProtectedByApp     = 0x00000800, | 
 | 49 |         eProtectedByDRM     = 0x00001000, | 
| Riley Andrews | 03414a1 | 2014-07-01 14:22:59 -0700 | [diff] [blame] | 50 |         eCursorWindow       = 0x00002000, | 
| Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 51 |  | 
 | 52 |         eFXSurfaceNormal    = 0x00000000, | 
| Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 53 |         eFXSurfaceDim       = 0x00020000, | 
| Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 54 |         eFXSurfaceMask      = 0x000F0000, | 
 | 55 |     }; | 
 | 56 |  | 
| Mathias Agopian | cc08e68 | 2010-04-15 18:48:26 -0700 | [diff] [blame] | 57 |     /* | 
 | 58 |      * Requires ACCESS_SURFACE_FLINGER permission | 
 | 59 |      */ | 
| Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 60 |     virtual status_t createSurface( | 
| Jeff Brown | 9d4e3d2 | 2012-08-24 20:00:51 -0700 | [diff] [blame] | 61 |             const String8& name, uint32_t w, uint32_t h, | 
| Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 62 |             PixelFormat format, uint32_t flags, | 
| Robert Carr | 1f0a16a | 2016-10-24 16:27:39 -0700 | [diff] [blame] | 63 |             const sp<IBinder>& parent, | 
| Mathias Agopian | 4d9b822 | 2013-03-12 17:11:48 -0700 | [diff] [blame] | 64 |             sp<IBinder>* handle, | 
 | 65 |             sp<IGraphicBufferProducer>* gbp) = 0; | 
| Mathias Agopian | 7e27f05 | 2010-05-28 14:22:23 -0700 | [diff] [blame] | 66 |  | 
| Mathias Agopian | cc08e68 | 2010-04-15 18:48:26 -0700 | [diff] [blame] | 67 |     /* | 
 | 68 |      * Requires ACCESS_SURFACE_FLINGER permission | 
 | 69 |      */ | 
| Mathias Agopian | ac9fa42 | 2013-02-11 16:40:36 -0800 | [diff] [blame] | 70 |     virtual status_t destroySurface(const sp<IBinder>& handle) = 0; | 
| Svetoslav | d85084b | 2014-03-20 10:28:31 -0700 | [diff] [blame] | 71 |  | 
 | 72 |     /* | 
 | 73 |      * Requires ACCESS_SURFACE_FLINGER permission | 
 | 74 |      */ | 
 | 75 |     virtual status_t clearLayerFrameStats(const sp<IBinder>& handle) const = 0; | 
 | 76 |  | 
 | 77 |     /* | 
 | 78 |      * Requires ACCESS_SURFACE_FLINGER permission | 
 | 79 |      */ | 
 | 80 |     virtual status_t getLayerFrameStats(const sp<IBinder>& handle, FrameStats* outStats) const = 0; | 
| Robert Carr | 367c568 | 2016-06-20 11:55:28 -0700 | [diff] [blame] | 81 |  | 
 | 82 |     virtual status_t getTransformToDisplayInverse(const sp<IBinder>& handle, | 
 | 83 |             bool* outTransformToDisplayInverse) const = 0; | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 84 | }; | 
 | 85 |  | 
 | 86 | // ---------------------------------------------------------------------------- | 
 | 87 |  | 
| Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 88 | class BnSurfaceComposerClient: public BnInterface<ISurfaceComposerClient> { | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 89 | public: | 
| Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 90 |     virtual status_t onTransact(uint32_t code, const Parcel& data, | 
 | 91 |             Parcel* reply, uint32_t flags = 0); | 
| The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 92 | }; | 
 | 93 |  | 
 | 94 | // ---------------------------------------------------------------------------- | 
 | 95 |  | 
 | 96 | }; // namespace android | 
 | 97 |  | 
| Mathias Agopian | 90ac799 | 2012-02-25 18:48:35 -0800 | [diff] [blame] | 98 | #endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H |