widget/gonk/nativewindow/FakeSurfaceComposer.cpp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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  */
    18 #include <stdint.h>
    19 #include <sys/types.h>
    20 #include <errno.h>
    21 #include <cutils/log.h>
    23 #include <gui/IDisplayEventConnection.h>
    24 #include <gui/GraphicBufferAlloc.h>
    26 #include "FakeSurfaceComposer.h"
    28 namespace android {
    30 /* static */
    31 void FakeSurfaceComposer::instantiate() {
    32     defaultServiceManager()->addService(
    33             String16("SurfaceFlinger"), new FakeSurfaceComposer());
    34 }
    36 FakeSurfaceComposer::FakeSurfaceComposer()
    37     : BnSurfaceComposer()
    38 {
    39 }
    41 FakeSurfaceComposer::~FakeSurfaceComposer()
    42 {
    43 }
    45 sp<ISurfaceComposerClient> FakeSurfaceComposer::createConnection()
    46 {
    47     return nullptr;
    48 }
    50 sp<IGraphicBufferAlloc> FakeSurfaceComposer::createGraphicBufferAlloc()
    51 {
    52     sp<GraphicBufferAlloc> gba(new GraphicBufferAlloc());
    53     return gba;
    54 }
    56 sp<IBinder> FakeSurfaceComposer::createDisplay(const String8& displayName,
    57         bool secure)
    58 {
    59     return nullptr;
    60 }
    62 #if ANDROID_VERSION >= 19
    63 void FakeSurfaceComposer::destroyDisplay(const sp<IBinder>& display)
    64 {
    65 }
    66 #endif
    68 sp<IBinder> FakeSurfaceComposer::getBuiltInDisplay(int32_t id) {
    69     return nullptr;
    70 }
    72 void FakeSurfaceComposer::setTransactionState(
    73         const Vector<ComposerState>& state,
    74         const Vector<DisplayState>& displays,
    75         uint32_t flags)
    76 {
    77 }
    79 void FakeSurfaceComposer::bootFinished()
    80 {
    81 }
    83 bool FakeSurfaceComposer::authenticateSurfaceTexture(
    84         const sp<IGraphicBufferProducer>& bufferProducer) const {
    85     return false;
    86 }
    88 sp<IDisplayEventConnection> FakeSurfaceComposer::createDisplayEventConnection() {
    89     return nullptr;
    90 }
    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 }
   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
   109 void FakeSurfaceComposer::blank(const sp<IBinder>& display) {
   110 }
   112 void FakeSurfaceComposer::unblank(const sp<IBinder>& display) {
   113 }
   115 status_t FakeSurfaceComposer::getDisplayInfo(const sp<IBinder>& display, DisplayInfo* info) {
   116     return INVALID_OPERATION;
   117 }
   119 }; // namespace android

mercurial