#include "third_party/blink/renderer/platform/graphics/gpu/xr_webgl_drawing_buffer.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "components/viz/common/resources/shared_image_format.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/client_shared_image.h"
#include "gpu/command_buffer/client/shared_image_interface.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h"
#include "third_party/blink/renderer/platform/graphics/gpu/extensions_3d_util.h"
#include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h"
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/skia/include/core/SkSurface.h"
namespace {
class ScopedPixelLocalStorageInterrupt { … };
}
namespace blink {
XRWebGLDrawingBuffer::ColorBuffer::ColorBuffer(
base::WeakPtr<XRWebGLDrawingBuffer> drawing_buffer,
const gfx::Size& size,
scoped_refptr<gpu::ClientSharedImage> shared_image,
GLuint texture_id)
: … { … }
XRWebGLDrawingBuffer::ColorBuffer::~ColorBuffer() { … }
scoped_refptr<XRWebGLDrawingBuffer> XRWebGLDrawingBuffer::Create(
DrawingBuffer* drawing_buffer,
GLuint framebuffer,
const gfx::Size& size,
bool want_alpha_channel,
bool want_depth_buffer,
bool want_stencil_buffer,
bool want_antialiasing) { … }
XRWebGLDrawingBuffer::XRWebGLDrawingBuffer(DrawingBuffer* drawing_buffer,
GLuint framebuffer,
bool discard_framebuffer_supported,
bool want_alpha_channel,
bool want_depth_buffer,
bool want_stencil_buffer)
: … { … }
void XRWebGLDrawingBuffer::BeginDestruction() { … }
bool XRWebGLDrawingBuffer::Initialize(const gfx::Size& size,
bool use_multisampling) { … }
gpu::gles2::GLES2Interface* XRWebGLDrawingBuffer::ContextGL() { … }
bool XRWebGLDrawingBuffer::ContextLost() { … }
gfx::Size XRWebGLDrawingBuffer::AdjustSize(const gfx::Size& new_size) { … }
void XRWebGLDrawingBuffer::UseSharedBuffer(
const gpu::MailboxHolder& buffer_mailbox_holder) { … }
void XRWebGLDrawingBuffer::DoneWithSharedBuffer() { … }
void XRWebGLDrawingBuffer::ClearBoundFramebuffer() { … }
void XRWebGLDrawingBuffer::Resize(const gfx::Size& new_size) { … }
scoped_refptr<XRWebGLDrawingBuffer::ColorBuffer>
XRWebGLDrawingBuffer::CreateColorBuffer() { … }
scoped_refptr<XRWebGLDrawingBuffer::ColorBuffer>
XRWebGLDrawingBuffer::CreateOrRecycleColorBuffer() { … }
bool XRWebGLDrawingBuffer::WantExplicitResolve() const { … }
void XRWebGLDrawingBuffer::BindAndResolveDestinationFramebuffer() { … }
void XRWebGLDrawingBuffer::SwapColorBuffers() { … }
scoped_refptr<StaticBitmapImage>
XRWebGLDrawingBuffer::TransferToStaticBitmapImage() { … }
void XRWebGLDrawingBuffer::NotifyMailboxReleased(
scoped_refptr<ColorBuffer> color_buffer,
const gpu::SyncToken& sync_token,
bool lost_resource) { … }
void XRWebGLDrawingBuffer::MailboxReleased(
scoped_refptr<ColorBuffer> color_buffer,
bool lost_resource) { … }
}