Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58b0cc83 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF/CE: Clean up header dependencies and combine mocks" into main

parents 81846f17 e98286f4
Loading
Loading
Loading
Loading
+41 −8
Original line number Diff line number Diff line
@@ -148,22 +148,35 @@ cc_defaults {
    },
}

// libsurfaceflinger_backend_{headers|sources} are a step towards pulling out
// the "backend" sources to clean up the dependency graph between
// CompositionEngine and SurfaceFlinger. Completing the cleanup would require
// moving the headers in particular so that the dependency can strictly be a
// DAG. There would certainly be additional cleanups: VirtualDisplaySurface.cpp
// and FrameBufferSurface.cpp likely belong in CompositionEngine for example.
cc_library_headers {
    name: "libsurfaceflinger_headers",
    name: "libsurfaceflinger_backend_headers",
    export_include_dirs: ["."],
    static_libs: ["libserviceutils"],
    export_static_lib_headers: ["libserviceutils"],

    shared_libs: [
        "android.hardware.configstore-utils",
        "android.hardware.configstore@1.0",
        "android.hardware.configstore@1.1",
        "libbinder_ndk",
    ],
    export_shared_lib_headers: [
        "android.hardware.configstore-utils",
        "android.hardware.configstore@1.0",
        "android.hardware.configstore@1.1",
        "libbinder_ndk",
    ],
}

filegroup {
    name: "libsurfaceflinger_sources",
    name: "libsurfaceflinger_backend_sources",
    srcs: [
        "BackgroundExecutor.cpp",
        "Client.cpp",
        "ClientCache.cpp",
        "Display/DisplayModeController.cpp",
        "Display/DisplaySnapshot.cpp",
        "DisplayDevice.cpp",
        "DisplayHardware/AidlComposerHal.cpp",
        "DisplayHardware/ComposerHal.cpp",
        "DisplayHardware/FramebufferSurface.cpp",
@@ -172,6 +185,26 @@ filegroup {
        "DisplayHardware/HidlComposerHal.cpp",
        "DisplayHardware/PowerAdvisor.cpp",
        "DisplayHardware/VirtualDisplaySurface.cpp",
    ],
}

cc_library_headers {
    name: "libsurfaceflinger_headers",
    export_include_dirs: ["."],
    static_libs: ["libserviceutils"],
    export_static_lib_headers: ["libserviceutils"],
}

filegroup {
    name: "libsurfaceflinger_sources",
    srcs: [
        ":libsurfaceflinger_backend_sources",
        "BackgroundExecutor.cpp",
        "Client.cpp",
        "ClientCache.cpp",
        "Display/DisplayModeController.cpp",
        "Display/DisplaySnapshot.cpp",
        "DisplayDevice.cpp",
        "DisplayRenderArea.cpp",
        "Effects/Daltonizer.cpp",
        "FrontEnd/LayerCreationArgs.cpp",
+7 −4
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ cc_defaults {
        "android.hardware.graphics.composer@2.3-command-buffer",
        "android.hardware.graphics.composer@2.4-command-buffer",
        "android.hardware.graphics.composer3-command-buffer",
        "libsurfaceflinger_headers",
        "libsurfaceflinger_backend_headers",
    ],
}

@@ -141,6 +141,8 @@ cc_test {
    ],
    srcs: [
        ":libcompositionengine_sources",
        ":libsurfaceflinger_backend_mock_sources",
        ":libsurfaceflinger_backend_sources",
        "tests/planner/CachedSetTest.cpp",
        "tests/planner/FlattenerTest.cpp",
        "tests/planner/LayerStateTest.cpp",
@@ -151,14 +153,14 @@ cc_test {
        "tests/DisplayTest.cpp",
        "tests/HwcAsyncWorkerTest.cpp",
        "tests/HwcBufferCacheTest.cpp",
        "tests/MockHWC2.cpp",
        "tests/MockHWComposer.cpp",
        "tests/MockPowerAdvisor.cpp",
        "tests/OutputLayerTest.cpp",
        "tests/OutputTest.cpp",
        "tests/ProjectionSpaceTest.cpp",
        "tests/RenderSurfaceTest.cpp",
    ],
    header_libs: [
        "libsurfaceflinger_backend_mock_headers",
    ],
    static_libs: [
        "libcompositionengine_mocks",
        "libgui_mocks",
@@ -167,6 +169,7 @@ cc_test {
        "libgtest",
    ],
    shared_libs: [
        "libbinder_ndk",
        // For some reason, libvulkan isn't picked up from librenderengine
        // Probably ASAN related?
        "libvulkan",
+1 −2
Original line number Diff line number Diff line
@@ -26,9 +26,8 @@
#include <gtest/gtest.h>
#include <renderengine/mock/RenderEngine.h>

#include "MockHWComposer.h"
#include "TimeStats/TimeStats.h"
#include "gmock/gmock.h"
#include "mock/DisplayHardware/MockHWComposer.h"

using namespace com::android::graphics::surfaceflinger;

+3 −3
Original line number Diff line number Diff line
@@ -36,10 +36,10 @@
#include <ui/Rect.h>
#include <ui/StaticDisplayInfo.h>

#include "MockHWC2.h"
#include "MockHWComposer.h"
#include "MockPowerAdvisor.h"
#include "ftl/future.h"
#include "mock/DisplayHardware/MockHWC2.h"
#include "mock/DisplayHardware/MockHWComposer.h"
#include "mock/DisplayHardware/MockPowerAdvisor.h"

#include <aidl/android/hardware/graphics/composer3/Composition.h>

+0 −32
Original line number Diff line number Diff line
/*
 * Copyright 2019 The Android Open Source Project

 * 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.
 */

#include "MockHWC2.h"

namespace android::HWC2 {

// This will go away once HWC2::Layer is moved into the "backend" library
Layer::~Layer() = default;

namespace mock {

// The Google Mock documentation recommends explicit non-header instantiations
// for better compile time performance.
Layer::Layer() = default;
Layer::~Layer() = default;

} // namespace mock
} // namespace android::HWC2
Loading