1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/gonk/nativewindow/FakeSurfaceComposer.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,119 @@ 1.4 +/* 1.5 + * Copyright (C) 2007 The Android Open Source Project 1.6 + * Copyright (C) 2013 Mozilla Foundation 1.7 + * 1.8 + * Licensed under the Apache License, Version 2.0 (the "License"); 1.9 + * you may not use this file except in compliance with the License. 1.10 + * You may obtain a copy of the License at 1.11 + * 1.12 + * http://www.apache.org/licenses/LICENSE-2.0 1.13 + * 1.14 + * Unless required by applicable law or agreed to in writing, software 1.15 + * distributed under the License is distributed on an "AS IS" BASIS, 1.16 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1.17 + * See the License for the specific language governing permissions and 1.18 + * limitations under the License. 1.19 + */ 1.20 + 1.21 +#include <stdint.h> 1.22 +#include <sys/types.h> 1.23 +#include <errno.h> 1.24 +#include <cutils/log.h> 1.25 + 1.26 +#include <gui/IDisplayEventConnection.h> 1.27 +#include <gui/GraphicBufferAlloc.h> 1.28 + 1.29 +#include "FakeSurfaceComposer.h" 1.30 + 1.31 +namespace android { 1.32 + 1.33 +/* static */ 1.34 +void FakeSurfaceComposer::instantiate() { 1.35 + defaultServiceManager()->addService( 1.36 + String16("SurfaceFlinger"), new FakeSurfaceComposer()); 1.37 +} 1.38 + 1.39 +FakeSurfaceComposer::FakeSurfaceComposer() 1.40 + : BnSurfaceComposer() 1.41 +{ 1.42 +} 1.43 + 1.44 +FakeSurfaceComposer::~FakeSurfaceComposer() 1.45 +{ 1.46 +} 1.47 + 1.48 +sp<ISurfaceComposerClient> FakeSurfaceComposer::createConnection() 1.49 +{ 1.50 + return nullptr; 1.51 +} 1.52 + 1.53 +sp<IGraphicBufferAlloc> FakeSurfaceComposer::createGraphicBufferAlloc() 1.54 +{ 1.55 + sp<GraphicBufferAlloc> gba(new GraphicBufferAlloc()); 1.56 + return gba; 1.57 +} 1.58 + 1.59 +sp<IBinder> FakeSurfaceComposer::createDisplay(const String8& displayName, 1.60 + bool secure) 1.61 +{ 1.62 + return nullptr; 1.63 +} 1.64 + 1.65 +#if ANDROID_VERSION >= 19 1.66 +void FakeSurfaceComposer::destroyDisplay(const sp<IBinder>& display) 1.67 +{ 1.68 +} 1.69 +#endif 1.70 + 1.71 +sp<IBinder> FakeSurfaceComposer::getBuiltInDisplay(int32_t id) { 1.72 + return nullptr; 1.73 +} 1.74 + 1.75 +void FakeSurfaceComposer::setTransactionState( 1.76 + const Vector<ComposerState>& state, 1.77 + const Vector<DisplayState>& displays, 1.78 + uint32_t flags) 1.79 +{ 1.80 +} 1.81 + 1.82 +void FakeSurfaceComposer::bootFinished() 1.83 +{ 1.84 +} 1.85 + 1.86 +bool FakeSurfaceComposer::authenticateSurfaceTexture( 1.87 + const sp<IGraphicBufferProducer>& bufferProducer) const { 1.88 + return false; 1.89 +} 1.90 + 1.91 +sp<IDisplayEventConnection> FakeSurfaceComposer::createDisplayEventConnection() { 1.92 + return nullptr; 1.93 +} 1.94 + 1.95 +status_t FakeSurfaceComposer::captureScreen(const sp<IBinder>& display, 1.96 + const sp<IGraphicBufferProducer>& producer, 1.97 + uint32_t reqWidth, uint32_t reqHeight, 1.98 + uint32_t minLayerZ, uint32_t maxLayerZ, 1.99 + bool isCpuConsumer) { 1.100 + return INVALID_OPERATION; 1.101 +} 1.102 + 1.103 +#if ANDROID_VERSION >= 19 1.104 +status_t FakeSurfaceComposer::captureScreen(const sp<IBinder>& display, 1.105 + const sp<IGraphicBufferProducer>& producer, 1.106 + uint32_t reqWidth, uint32_t reqHeight, 1.107 + uint32_t minLayerZ, uint32_t maxLayerZ) { 1.108 + return INVALID_OPERATION; 1.109 +} 1.110 +#endif 1.111 + 1.112 +void FakeSurfaceComposer::blank(const sp<IBinder>& display) { 1.113 +} 1.114 + 1.115 +void FakeSurfaceComposer::unblank(const sp<IBinder>& display) { 1.116 +} 1.117 + 1.118 +status_t FakeSurfaceComposer::getDisplayInfo(const sp<IBinder>& display, DisplayInfo* info) { 1.119 + return INVALID_OPERATION; 1.120 +} 1.121 + 1.122 +}; // namespace android