chromium/components/viz/service/display/overlay_processor_interface.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/viz/service/display/overlay_processor_interface.h"

#include <utility>

#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "build/chromecast_buildflags.h"
#include "build/chromeos_buildflags.h"
#include "components/viz/common/buildflags.h"
#include "components/viz/common/display/renderer_settings.h"
#include "components/viz/common/features.h"
#include "components/viz/service/display/display_compositor_memory_and_task_controller.h"
#include "components/viz/service/display/overlay_processor_stub.h"
#include "ui/gfx/overlay_priority_hint.h"

#if BUILDFLAG(IS_APPLE)
#include "components/viz/service/display/overlay_processor_mac.h"
#elif BUILDFLAG(IS_WIN)
#include "components/viz/service/display/overlay_processor_win.h"
#elif BUILDFLAG(IS_ANDROID)
#include "components/viz/service/display/overlay_processor_android.h"
#include "components/viz/service/display/overlay_processor_surface_control.h"
#elif BUILDFLAG(IS_OZONE)
#include "components/viz/service/display/overlay_processor_delegated.h"
#include "components/viz/service/display/overlay_processor_ozone.h"
#include "ui/ozone/public/overlay_manager_ozone.h"
#include "ui/ozone/public/ozone_platform.h"
#endif

namespace viz {
namespace {
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class UnderlayDamage {};
}  // namespace

// Record UMA histograms for overlays
// 1. Underlay vs. Overlay
// 2. Full screen mode vs. Non Full screen (Windows) mode
// 3. Overlay zero damage rect vs. non zero damage rect
// 4. Underlay zero damage rect, non-zero damage rect with non-occluding damage
//   only, non-zero damage rect with occluding damage, and non-zero damage rect
//   with both damages

// static
void OverlayProcessorInterface::RecordOverlayDamageRectHistograms(
    bool is_overlay,
    bool has_occluding_surface_damage,
    bool zero_damage_rect) {}

OverlayProcessorInterface::OutputSurfaceOverlayPlane::
    OutputSurfaceOverlayPlane() = default;
OverlayProcessorInterface::OutputSurfaceOverlayPlane::OutputSurfaceOverlayPlane(
    const OutputSurfaceOverlayPlane&) = default;
OverlayProcessorInterface::OutputSurfaceOverlayPlane&
OverlayProcessorInterface::OutputSurfaceOverlayPlane::operator=(
    const OutputSurfaceOverlayPlane&) = default;
OverlayProcessorInterface::OutputSurfaceOverlayPlane::
    ~OutputSurfaceOverlayPlane() = default;

std::unique_ptr<OverlayProcessorInterface>
OverlayProcessorInterface::CreateOverlayProcessor(
    OutputSurface* output_surface,
    gpu::SurfaceHandle surface_handle,
    const OutputSurface::Capabilities& capabilities,
    DisplayCompositorMemoryAndTaskController* display_controller,
    gpu::SharedImageInterface* shared_image_interface,
    const RendererSettings& renderer_settings,
    const DebugRendererSettings* debug_settings) {}

bool OverlayProcessorInterface::DisableSplittingQuads() const {}

OverlayProcessorInterface::OutputSurfaceOverlayPlane
OverlayProcessorInterface::ProcessOutputSurfaceAsOverlay(
    const gfx::Size& viewport_size,
    const gfx::Size& resource_size,
    const SharedImageFormat si_format,
    const gfx::ColorSpace& color_space,
    bool has_alpha,
    float opacity,
    const gpu::Mailbox& mailbox) {}

void OverlayProcessorInterface::ScheduleOverlays(
    DisplayResourceProvider* display_resource_provider) {}

void OverlayProcessorInterface::OverlayPresentationComplete() {}

gfx::CALayerResult OverlayProcessorInterface::GetCALayerErrorCode() const {}

gfx::RectF OverlayProcessorInterface::GetUnassignedDamage() const {}

bool OverlayProcessorInterface::SupportsFlipRotateTransform() const {}

}  // namespace viz