#include "gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.h"
#include <algorithm>
#include <list>
#include <optional>
#include "base/feature_list.h"
#include "components/viz/common/resources/shared_image_format.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "gpu/command_buffer/service/service_utils.h"
#include "gpu/command_buffer/service/shared_image/gl_texture_holder.h"
#include "gpu/config/gpu_preferences.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_version_info.h"
#include "ui/gl/progress_reporter.h"
namespace gpu {
namespace {
BASE_FEATURE(…);
std::optional<viz::SharedImageFormat> GetFallbackFormatIfNotSupported(
viz::SharedImageFormat plane_format,
const GLFormatCaps& caps) { … }
std::vector<GLCommonImageBackingFactory::FormatInfo> GetMultiPlaneFormatInfo(
const std::map<viz::SharedImageFormat,
GLCommonImageBackingFactory::FormatInfo>& supported_formats,
const GLFormatCaps& gl_format_caps,
viz::SharedImageFormat format) { … }
}
GLCommonImageBackingFactory::GLCommonImageBackingFactory(
SharedImageUsageSet supported_usages,
const GpuPreferences& gpu_preferences,
const GpuDriverBugWorkarounds& workarounds,
const gles2::FeatureInfo* feature_info,
gl::ProgressReporter* progress_reporter)
: … { … }
GLCommonImageBackingFactory::~GLCommonImageBackingFactory() = default;
std::vector<GLCommonImageBackingFactory::FormatInfo>
GLCommonImageBackingFactory::GetFormatInfo(
viz::SharedImageFormat format) const { … }
bool GLCommonImageBackingFactory::CanCreateTexture(
viz::SharedImageFormat format,
const gfx::Size& size,
base::span<const uint8_t> pixel_data,
GLenum target) { … }
GLCommonImageBackingFactory::FormatInfo::FormatInfo() = default;
GLCommonImageBackingFactory::FormatInfo::FormatInfo(const FormatInfo& other) =
default;
GLCommonImageBackingFactory::FormatInfo::~FormatInfo() = default;
}