chromium/content/browser/gpu/gpu_data_manager_impl.cc

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

#include "content/browser/gpu/gpu_data_manager_impl.h"

#include "base/no_destructor.h"
#include "build/build_config.h"
#include "content/browser/gpu/gpu_data_manager_impl_private.h"
#include "content/public/browser/browser_thread.h"
#include "gpu/ipc/common/memory_stats.h"
#include "mojo/public/cpp/bindings/receiver_set.h"

namespace content {

namespace {

bool g_initialized =;

// Implementation of the Blink GpuDataManager interface to forward requests from
// a renderer to the GpuDataManagerImpl.
class GpuDataManagerReceiver : public blink::mojom::GpuDataManager {};

GpuDataManagerReceiver& GetGpuDataManagerReceiver() {}

}  // namespace

// static
GpuDataManager* GpuDataManager::GetInstance() {}

// static
bool GpuDataManager::Initialized() {}

// static
GpuDataManagerImpl* GpuDataManagerImpl::GetInstance() {}

// static
bool GpuDataManagerImpl::Initialized() {}

void GpuDataManagerImpl::BlocklistWebGLForTesting() {}

void GpuDataManagerImpl::SetSkiaGraphiteEnabledForTesting(bool enabled) {}

gpu::GPUInfo GpuDataManagerImpl::GetGPUInfo() {}

gpu::GpuFeatureStatus GpuDataManagerImpl::GetFeatureStatus(
    gpu::GpuFeatureType feature) {}

bool GpuDataManagerImpl::GpuAccessAllowed(std::string* reason) {}

void GpuDataManagerImpl::RequestDx12VulkanVideoGpuInfoIfNeeded(
    GpuInfoRequest request,
    bool delayed) {}

bool GpuDataManagerImpl::IsEssentialGpuInfoAvailable() {}

bool GpuDataManagerImpl::IsDx12VulkanVersionAvailable() const {}

bool GpuDataManagerImpl::IsGpuFeatureInfoAvailable() const {}

void GpuDataManagerImpl::RequestVideoMemoryUsageStatsUpdate(
    VideoMemoryUsageStatsCallback callback) {}

void GpuDataManagerImpl::AddObserver(GpuDataManagerObserver* observer) {}

void GpuDataManagerImpl::RemoveObserver(GpuDataManagerObserver* observer) {}

void GpuDataManagerImpl::DisableHardwareAcceleration() {}

bool GpuDataManagerImpl::HardwareAccelerationEnabled() {}

void GpuDataManagerImpl::AppendGpuCommandLine(base::CommandLine* command_line,
                                              GpuProcessKind kind) {}

void GpuDataManagerImpl::StartUmaTimer() {}

void GpuDataManagerImpl::UpdateGpuInfo(
    const gpu::GPUInfo& gpu_info,
    const std::optional<gpu::GPUInfo>& gpu_info_for_hardware_gpu) {}

#if BUILDFLAG(IS_WIN)

void GpuDataManagerImpl::UpdateDirectXInfo(uint32_t d3d12_feature_level,
                                           uint32_t directml_feature_level) {
  base::AutoLock auto_lock(lock_);
  private_->UpdateDirectXInfo(d3d12_feature_level, directml_feature_level);
}

void GpuDataManagerImpl::UpdateVulkanInfo(uint32_t vulkan_version) {
  base::AutoLock auto_lock(lock_);
  private_->UpdateVulkanInfo(vulkan_version);
}

void GpuDataManagerImpl::UpdateDevicePerfInfo(
    const gpu::DevicePerfInfo& device_perf_info) {
  base::AutoLock auto_lock(lock_);
  private_->UpdateDevicePerfInfo(device_perf_info);
}

void GpuDataManagerImpl::UpdateOverlayInfo(
    const gpu::OverlayInfo& overlay_info) {
  base::AutoLock auto_lock(lock_);
  private_->UpdateOverlayInfo(overlay_info);
}
void GpuDataManagerImpl::UpdateDXGIInfo(gfx::mojom::DXGIInfoPtr dxgi_info) {
  base::AutoLock auto_lock(lock_);
  private_->UpdateDXGIInfo(std::move(dxgi_info));
}

void GpuDataManagerImpl::UpdateDirectXRequestStatus(bool request_continues) {
  base::AutoLock auto_lock(lock_);
  private_->UpdateDirectXRequestStatus(request_continues);
}

void GpuDataManagerImpl::UpdateVulkanRequestStatus(bool request_continues) {
  base::AutoLock auto_lock(lock_);
  private_->UpdateVulkanRequestStatus(request_continues);
}

bool GpuDataManagerImpl::DirectXRequested() const {
  base::AutoLock auto_lock(lock_);
  return private_->DirectXRequested();
}

bool GpuDataManagerImpl::VulkanRequested() const {
  base::AutoLock auto_lock(lock_);
  return private_->VulkanRequested();
}

void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() {
  base::AutoLock auto_lock(lock_);
  private_->TerminateInfoCollectionGpuProcess();
}
#endif  // BUILDFLAG(IS_WIN)

void GpuDataManagerImpl::PostCreateThreads() {}

void GpuDataManagerImpl::UpdateDawnInfo(
    const std::vector<std::string>& dawn_info_list) {}

void GpuDataManagerImpl::UpdateGpuFeatureInfo(
    const gpu::GpuFeatureInfo& gpu_feature_info,
    const std::optional<gpu::GpuFeatureInfo>&
        gpu_feature_info_for_hardware_gpu) {}

void GpuDataManagerImpl::UpdateGpuExtraInfo(
    const gfx::GpuExtraInfo& gpu_extra_info) {}

void GpuDataManagerImpl::UpdateMojoMediaVideoDecoderCapabilities(
    const media::SupportedVideoDecoderConfigs& configs) {}

void GpuDataManagerImpl::UpdateMojoMediaVideoEncoderCapabilities(
    const media::VideoEncodeAccelerator::SupportedProfiles&
        supported_profiles) {}

gpu::GpuFeatureInfo GpuDataManagerImpl::GetGpuFeatureInfo() const {}

gpu::GPUInfo GpuDataManagerImpl::GetGPUInfoForHardwareGpu() const {}

gpu::GpuFeatureInfo GpuDataManagerImpl::GetGpuFeatureInfoForHardwareGpu()
    const {}

std::vector<std::string> GpuDataManagerImpl::GetDawnInfoList() const {}

bool GpuDataManagerImpl::GpuAccessAllowedForHardwareGpu(std::string* reason) {}

bool GpuDataManagerImpl::IsGpuCompositingDisabledForHardwareGpu() const {}

gfx::GpuExtraInfo GpuDataManagerImpl::GetGpuExtraInfo() const {}

bool GpuDataManagerImpl::IsGpuCompositingDisabled() const {}

void GpuDataManagerImpl::SetGpuCompositingDisabled() {}

void GpuDataManagerImpl::UpdateGpuPreferences(
    gpu::GpuPreferences* gpu_preferences,
    GpuProcessKind kind) const {}

void GpuDataManagerImpl::AddLogMessage(int level,
                                       const std::string& header,
                                       const std::string& message) {}

void GpuDataManagerImpl::ProcessCrashed() {}

base::Value::List GpuDataManagerImpl::GetLogMessages() const {}

void GpuDataManagerImpl::HandleGpuSwitch() {}

void GpuDataManagerImpl::BlockDomainsFrom3DAPIs(const std::set<GURL>& urls,
                                                gpu::DomainGuilt guilt) {}

bool GpuDataManagerImpl::Are3DAPIsBlocked(const GURL& top_origin_url,
                                          ThreeDAPIType requester) {}

void GpuDataManagerImpl::UnblockDomainFrom3DAPIs(const GURL& url) {}

void GpuDataManagerImpl::DisableDomainBlockingFor3DAPIsForTesting() {}

gpu::GpuMode GpuDataManagerImpl::GetGpuMode() const {}

void GpuDataManagerImpl::FallBackToNextGpuMode() {}

bool GpuDataManagerImpl::CanFallback() const {}

bool GpuDataManagerImpl::IsGpuProcessUsingHardwareGpu() const {}

void GpuDataManagerImpl::SetApplicationVisible(bool is_visible) {}

void GpuDataManagerImpl::OnDisplayAdded(const display::Display& new_display) {}

void GpuDataManagerImpl::OnDisplaysRemoved(
    const display::Displays& removed_displays) {}

void GpuDataManagerImpl::OnDisplayMetricsChanged(
    const display::Display& display,
    uint32_t changed_metrics) {}

#if BUILDFLAG(IS_LINUX)
bool GpuDataManagerImpl::IsGpuMemoryBufferNV12Supported() {}
void GpuDataManagerImpl::SetGpuMemoryBufferNV12Supported(bool supported) {}
#endif  // BUILDFLAG(IS_LINUX)

// static
void GpuDataManagerImpl::BindReceiver(
    mojo::PendingReceiver<blink::mojom::GpuDataManager> receiver) {}

GpuDataManagerImpl::GpuDataManagerImpl()
    :{}

GpuDataManagerImpl::~GpuDataManagerImpl() = default;

}  // namespace content