chromium/gpu/command_buffer/service/shared_image/ozone_image_gl_textures_holder.cc

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

#include "gpu/command_buffer/service/shared_image/ozone_image_gl_textures_holder.h"

#include <memory>

#include "base/check.h"
#include "base/memory/scoped_refptr.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/shared_image/shared_image_backing.h"
#include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/native_pixmap.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/scoped_binders.h"
#include "ui/ozone/public/gl_ozone.h"
#include "ui/ozone/public/native_pixmap_gl_binding.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/surface_factory_ozone.h"

namespace gpu {

namespace {

// Returns BufferFormat for given `format` and `plane_index`.
gfx::BufferFormat GetBufferFormatForPlane(viz::SharedImageFormat format,
                                          int plane_index) {}

gfx::BufferPlane GetBufferPlane(viz::SharedImageFormat format,
                                int plane_index) {}

// Create a NativePixmapGLBinding for the given `pixmap`. On failure, returns
// nullptr.
std::unique_ptr<ui::NativePixmapGLBinding> GetBinding(
    scoped_refptr<gfx::NativePixmap> pixmap,
    gfx::BufferFormat buffer_format,
    gfx::BufferPlane buffer_plane,
    const gfx::Size& size,
    const gfx::ColorSpace& color_space,
    GLuint& gl_texture_service_id,
    GLenum& target) {}

}  // namespace

// static
scoped_refptr<OzoneImageGLTexturesHolder>
OzoneImageGLTexturesHolder::CreateAndInitTexturesHolder(
    SharedImageBacking* backing,
    scoped_refptr<gfx::NativePixmap> pixmap) {}

OzoneImageGLTexturesHolder::OzoneImageGLTexturesHolder() = default;

OzoneImageGLTexturesHolder::~OzoneImageGLTexturesHolder() = default;

void OzoneImageGLTexturesHolder::MarkContextLost() {}

bool OzoneImageGLTexturesHolder::WasContextLost() {}

void OzoneImageGLTexturesHolder::OnAddedToCache() {}

void OzoneImageGLTexturesHolder::OnRemovedFromCache() {}

size_t OzoneImageGLTexturesHolder::GetCacheCount() const {}

void OzoneImageGLTexturesHolder::DestroyTextures() {}

size_t OzoneImageGLTexturesHolder::GetNumberOfTextures() const {}

bool OzoneImageGLTexturesHolder::Initialize(
    SharedImageBacking* backing,
    scoped_refptr<gfx::NativePixmap> pixmap) {}

bool OzoneImageGLTexturesHolder::CreateAndStoreTexture(
    SharedImageBacking* backing,
    scoped_refptr<gfx::NativePixmap> pixmap,
    gfx::BufferFormat buffer_format,
    gfx::BufferPlane buffer_plane,
    const gfx::Size& size) {}

}  // namespace gpu