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