#include "gpu/command_buffer/service/shared_image/gl_texture_holder.h"
#include "base/bits.h"
#include "build/build_config.h"
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/command_buffer/service/shared_image/gl_repack_utils.h"
#include "gpu/command_buffer/service/shared_image/shared_image_gl_utils.h"
#include "gpu/command_buffer/service/skia_utils.h"
#include "third_party/skia/include/gpu/GrContextThreadSafeProxy.h"
#include "third_party/skia/include/private/chromium/GrPromiseImageTexture.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_version_info.h"
#include "ui/gl/progress_reporter.h"
#include "ui/gl/scoped_binders.h"
#include "ui/gl/scoped_restore_texture.h"
namespace gpu {
namespace {
bool SupportsUnpackSubimage() { … }
bool SupportsPackSubimage() { … }
constexpr int ComputeBestAlignment(size_t bytes_per_pixel, size_t stride) { … }
}
viz::SharedImageFormat GLTextureHolder::GetPlaneFormat(
viz::SharedImageFormat format,
int plane_index) { … }
GLTextureHolder::GLTextureHolder(viz::SharedImageFormat format,
const gfx::Size& size,
bool is_passthrough,
gl::ProgressReporter* progress_reporter)
: … { … }
GLTextureHolder::GLTextureHolder(GLTextureHolder&& other) { … }
GLTextureHolder& GLTextureHolder::operator=(GLTextureHolder&& other) { … }
GLTextureHolder::~GLTextureHolder() { … }
GLuint GLTextureHolder::GetServiceId() const { … }
void GLTextureHolder::Initialize(
const GLCommonImageBackingFactory::FormatInfo& format_info,
bool framebuffer_attachment_angle,
base::span<const uint8_t> pixel_data,
const std::string& debug_label) { … }
void GLTextureHolder::InitializeWithTexture(
const GLFormatDesc& format_desc,
scoped_refptr<gles2::TexturePassthrough> texture) { … }
void GLTextureHolder::InitializeWithTexture(const GLFormatDesc& format_desc,
gles2::Texture* texture) { … }
bool GLTextureHolder::UploadFromMemory(const SkPixmap& pixmap) { … }
bool GLTextureHolder::ReadbackToMemory(const SkPixmap& pixmap) { … }
sk_sp<GrPromiseImageTexture> GLTextureHolder::GetPromiseImage(
SharedContextState* context_state) { … }
gfx::Rect GLTextureHolder::GetClearedRect() const { … }
void GLTextureHolder::SetClearedRect(const gfx::Rect& cleared_rect) { … }
void GLTextureHolder::SetContextLost() { … }
}