#include "gpu/command_buffer/service/shared_image/gl_texture_passthrough_fallback_image_representation.h"
#include "base/bits.h"
#include "components/viz/common/resources/shared_image_format_utils.h"
#include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h"
#include "gpu/command_buffer/service/shared_image/shared_image_gl_utils.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/progress_reporter.h"
#include "ui/gl/scoped_restore_texture.h"
namespace gpu {
namespace {
GLFormatDesc GetGLFormatDesc(viz::SharedImageFormat format,
int plane_index,
const GLFormatCaps& gl_format_caps) { … }
scoped_refptr<gles2::TexturePassthrough> CreateGLTexture(
const GLFormatDesc& format_desc,
const gfx::Size& size,
gl::ProgressReporter* progress_reporter) { … }
}
GLTexturePassthroughFallbackImageRepresentation::
GLTexturePassthroughFallbackImageRepresentation(
SharedImageManager* manager,
SharedImageBacking* backing,
MemoryTypeTracker* tracker,
gl::ProgressReporter* progress_reporter,
const GLFormatCaps& gl_format_caps)
: … { … }
GLTexturePassthroughFallbackImageRepresentation::
~GLTexturePassthroughFallbackImageRepresentation() = default;
const scoped_refptr<gles2::TexturePassthrough>&
GLTexturePassthroughFallbackImageRepresentation::GetTexturePassthrough(
int plane_index) { … }
bool GLTexturePassthroughFallbackImageRepresentation::BeginAccess(GLenum mode) { … }
void GLTexturePassthroughFallbackImageRepresentation::EndAccess() { … }
}