|
1 /* |
|
2 * Copyright (C) 2007 The Android Open Source Project |
|
3 * Copyright (C) 2013 Mozilla Foundation |
|
4 * |
|
5 * Licensed under the Apache License, Version 2.0 (the "License"); |
|
6 * you may not use this file except in compliance with the License. |
|
7 * You may obtain a copy of the License at |
|
8 * |
|
9 * http://www.apache.org/licenses/LICENSE-2.0 |
|
10 * |
|
11 * Unless required by applicable law or agreed to in writing, software |
|
12 * distributed under the License is distributed on an "AS IS" BASIS, |
|
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 * See the License for the specific language governing permissions and |
|
15 * limitations under the License. |
|
16 */ |
|
17 |
|
18 #include <stdint.h> |
|
19 #include <sys/types.h> |
|
20 #include <errno.h> |
|
21 #include <cutils/log.h> |
|
22 |
|
23 #include <gui/IDisplayEventConnection.h> |
|
24 #include <gui/GraphicBufferAlloc.h> |
|
25 |
|
26 #include "FakeSurfaceComposer.h" |
|
27 |
|
28 namespace android { |
|
29 |
|
30 /* static */ |
|
31 void FakeSurfaceComposer::instantiate() { |
|
32 defaultServiceManager()->addService( |
|
33 String16("SurfaceFlinger"), new FakeSurfaceComposer()); |
|
34 } |
|
35 |
|
36 FakeSurfaceComposer::FakeSurfaceComposer() |
|
37 : BnSurfaceComposer() |
|
38 { |
|
39 } |
|
40 |
|
41 FakeSurfaceComposer::~FakeSurfaceComposer() |
|
42 { |
|
43 } |
|
44 |
|
45 sp<ISurfaceComposerClient> FakeSurfaceComposer::createConnection() |
|
46 { |
|
47 return nullptr; |
|
48 } |
|
49 |
|
50 sp<IGraphicBufferAlloc> FakeSurfaceComposer::createGraphicBufferAlloc() |
|
51 { |
|
52 sp<GraphicBufferAlloc> gba(new GraphicBufferAlloc()); |
|
53 return gba; |
|
54 } |
|
55 |
|
56 sp<IBinder> FakeSurfaceComposer::createDisplay(const String8& displayName, |
|
57 bool secure) |
|
58 { |
|
59 return nullptr; |
|
60 } |
|
61 |
|
62 #if ANDROID_VERSION >= 19 |
|
63 void FakeSurfaceComposer::destroyDisplay(const sp<IBinder>& display) |
|
64 { |
|
65 } |
|
66 #endif |
|
67 |
|
68 sp<IBinder> FakeSurfaceComposer::getBuiltInDisplay(int32_t id) { |
|
69 return nullptr; |
|
70 } |
|
71 |
|
72 void FakeSurfaceComposer::setTransactionState( |
|
73 const Vector<ComposerState>& state, |
|
74 const Vector<DisplayState>& displays, |
|
75 uint32_t flags) |
|
76 { |
|
77 } |
|
78 |
|
79 void FakeSurfaceComposer::bootFinished() |
|
80 { |
|
81 } |
|
82 |
|
83 bool FakeSurfaceComposer::authenticateSurfaceTexture( |
|
84 const sp<IGraphicBufferProducer>& bufferProducer) const { |
|
85 return false; |
|
86 } |
|
87 |
|
88 sp<IDisplayEventConnection> FakeSurfaceComposer::createDisplayEventConnection() { |
|
89 return nullptr; |
|
90 } |
|
91 |
|
92 status_t FakeSurfaceComposer::captureScreen(const sp<IBinder>& display, |
|
93 const sp<IGraphicBufferProducer>& producer, |
|
94 uint32_t reqWidth, uint32_t reqHeight, |
|
95 uint32_t minLayerZ, uint32_t maxLayerZ, |
|
96 bool isCpuConsumer) { |
|
97 return INVALID_OPERATION; |
|
98 } |
|
99 |
|
100 #if ANDROID_VERSION >= 19 |
|
101 status_t FakeSurfaceComposer::captureScreen(const sp<IBinder>& display, |
|
102 const sp<IGraphicBufferProducer>& producer, |
|
103 uint32_t reqWidth, uint32_t reqHeight, |
|
104 uint32_t minLayerZ, uint32_t maxLayerZ) { |
|
105 return INVALID_OPERATION; |
|
106 } |
|
107 #endif |
|
108 |
|
109 void FakeSurfaceComposer::blank(const sp<IBinder>& display) { |
|
110 } |
|
111 |
|
112 void FakeSurfaceComposer::unblank(const sp<IBinder>& display) { |
|
113 } |
|
114 |
|
115 status_t FakeSurfaceComposer::getDisplayInfo(const sp<IBinder>& display, DisplayInfo* info) { |
|
116 return INVALID_OPERATION; |
|
117 } |
|
118 |
|
119 }; // namespace android |