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

Commit 3f82d313 authored by Corey Tabaka's avatar Corey Tabaka
Browse files

Remove unnecessary clients and rename files.

- Remove clients for obsolete services.
- Rename display protocol defs file to match purpose.
- Rename display manager client file. "impl" does not match naming
  conventions used by DVR libraries.
- Remove video mesh surface interface. This will be replaced by more
  general surface support in the unified O compositor.

Bug: 36401174
Test: Build; run cube sea.
Change-Id: Idb782623319329f6fa1b0aa45005d9fee3b9957d
parent 2b99ee56
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -15,15 +15,13 @@
sourceFiles = [
    "native_buffer_queue.cpp",
    "display_client.cpp",
    "display_manager_client_impl.cpp",
    "display_rpc.cpp",
    "display_manager_client.cpp",
    "display_protocol.cpp",
    "dummy_native_window.cpp",
    "gl_fenced_flush.cpp",
    "graphics.cpp",
    "late_latch.cpp",
    "video_mesh_surface_client.cpp",
    "vsync_client.cpp",
    "screenshot_client.cpp",
    "frame_history.cpp",
]

+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@

#include <mutex>

#include <private/dvr/display_rpc.h>
#include <private/dvr/display_protocol.h>
#include <private/dvr/late_latch.h>
#include <private/dvr/native_buffer.h>

+2 −2
Original line number Diff line number Diff line
#include "include/private/dvr/display_manager_client_impl.h"
#include "include/private/dvr/display_manager_client.h"

#include <pdx/default_transport/client_channel_factory.h>
#include <private/dvr/buffer_hub_client.h>
#include <private/dvr/display_rpc.h>
#include <private/dvr/display_protocol.h>
#include <utils/Log.h>

using android::pdx::LocalChannelHandle;
+1 −1
Original line number Diff line number Diff line
#include "include/private/dvr/display_rpc.h"
#include "include/private/dvr/display_protocol.h"

namespace android {
namespace dvr {
+0 −46
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@
#include <private/dvr/late_latch.h>
#include <private/dvr/native_buffer_queue.h>
#include <private/dvr/sensor_constants.h>
#include <private/dvr/video_mesh_surface_client.h>
#include <private/dvr/vsync_client.h>
#include <private/dvr/platform_defines.h>

@@ -542,10 +541,6 @@ struct DvrGraphicsContext : public android::ANativeObjectBase<
  // LateLatch support.
  std::unique_ptr<android::dvr::LateLatch> late_latch;

  // Video mesh support.
  std::vector<std::shared_ptr<android::dvr::VideoMeshSurfaceClient>>
      video_mesh_surfaces;

 private:
  // ANativeWindow function implementations
  std::mutex lock_;
@@ -1533,44 +1528,3 @@ extern "C" int dvrGraphicsSurfaceGetZOrder(
  return graphics_context->display_surface->z_order();
}
extern "C" DvrVideoMeshSurface* dvrGraphicsVideoMeshSurfaceCreate(
    DvrGraphicsContext* graphics_context) {
  auto display_surface = graphics_context->display_surface;
  // A DisplaySurface must be created prior to the creation of a
  // VideoMeshSurface.
  LOG_ALWAYS_FATAL_IF(display_surface == nullptr);

  LocalChannelHandle surface_handle = display_surface->CreateVideoMeshSurface();
  if (!surface_handle.valid()) {
    return nullptr;
  }

  std::unique_ptr<DvrVideoMeshSurface> surface(new DvrVideoMeshSurface);
  surface->client =
      android::dvr::VideoMeshSurfaceClient::Import(std::move(surface_handle));

  // TODO(jwcai) The next line is not needed...
  auto producer_queue = surface->client->GetProducerQueue();
  return surface.release();
}

extern "C" void dvrGraphicsVideoMeshSurfaceDestroy(
    DvrVideoMeshSurface* surface) {
  delete surface;
}

extern "C" void dvrGraphicsVideoMeshSurfacePresent(
    DvrGraphicsContext* graphics_context, DvrVideoMeshSurface* surface,
    const int eye, const float* transform) {
  volatile android::dvr::VideoMeshSurfaceMetadata* metadata =
      surface->client->GetMetadataBufferPtr();

  const uint32_t graphics_buffer_index =
      graphics_context->current_buffer->surface_buffer_index();

  for (int i = 0; i < 4; ++i) {
    metadata->transform[graphics_buffer_index][eye].val[i] = {
        transform[i + 0], transform[i + 4], transform[i + 8], transform[i + 12],
    };
  }
}
Loading