michael@0: /* michael@0: * Copyright (C) 2007 The Android Open Source Project michael@0: * Copyright (C) 2013 Mozilla Foundation michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: #ifndef NATIVEWINDOW_FAKE_SURFACE_COMPOSER_H michael@0: #define NATIVEWINDOW_FAKE_SURFACE_COMPOSER_H michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include michael@0: michael@0: #include michael@0: michael@0: #include michael@0: #include michael@0: michael@0: namespace android { michael@0: michael@0: // --------------------------------------------------------------------------- michael@0: michael@0: class IGraphicBufferAlloc; michael@0: michael@0: class FakeSurfaceComposer : public BinderService, michael@0: public BnSurfaceComposer michael@0: { michael@0: public: michael@0: static char const* getServiceName() { michael@0: return "FakeSurfaceComposer"; michael@0: } michael@0: michael@0: // Instantiate MediaResourceManagerService and register to service manager. michael@0: // If service manager is not present, wait until service manager becomes present. michael@0: static void instantiate(); michael@0: #if ANDROID_VERSION >= 19 michael@0: virtual void destroyDisplay(const sp& display); michael@0: virtual status_t captureScreen(const sp& display, const sp& producer, michael@0: uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ); michael@0: #endif michael@0: michael@0: private: michael@0: FakeSurfaceComposer(); michael@0: // We're reference counted, never destroy FakeSurfaceComposer directly michael@0: virtual ~FakeSurfaceComposer(); michael@0: michael@0: /* ------------------------------------------------------------------------ michael@0: * ISurfaceComposer interface michael@0: */ michael@0: virtual sp createConnection(); michael@0: virtual sp createGraphicBufferAlloc(); michael@0: virtual sp createDisplay(const String8& displayName, bool secure); michael@0: virtual sp getBuiltInDisplay(int32_t id); michael@0: virtual void setTransactionState(const Vector& state, michael@0: const Vector& displays, uint32_t flags); michael@0: virtual void bootFinished(); michael@0: virtual bool authenticateSurfaceTexture( michael@0: const sp& bufferProducer) const; michael@0: virtual sp createDisplayEventConnection(); michael@0: virtual status_t captureScreen(const sp& display, michael@0: const sp& producer, michael@0: uint32_t reqWidth, uint32_t reqHeight, michael@0: uint32_t minLayerZ, uint32_t maxLayerZ, bool isCpuConsumer); michael@0: // called when screen needs to turn off michael@0: virtual void blank(const sp& display); michael@0: // called when screen is turning back on michael@0: virtual void unblank(const sp& display); michael@0: virtual status_t getDisplayInfo(const sp& display, DisplayInfo* info); michael@0: michael@0: }; michael@0: michael@0: // --------------------------------------------------------------------------- michael@0: }; // namespace android michael@0: michael@0: #endif // NATIVEWINDOW_FAKE_SURFACE_COMPOSER_H