#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/ozone/demo/skia/skia_surfaceless_gl_renderer.h"
#include <stddef.h>
#include <memory>
#include <utility>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/trace_event/trace_event.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkTypeface.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLAssembleInterface.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
#include "third_party/skia/include/private/chromium/GrDeferredDisplayList.h"
#include "ui/display/types/display_snapshot.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rrect_f.h"
#include "ui/gfx/gpu_fence.h"
#include "ui/gfx/native_pixmap.h"
#include "ui/gfx/overlay_plane_data.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_surface.h"
#include "ui/ozone/public/native_pixmap_gl_binding.h"
#include "ui/ozone/public/overlay_candidates_ozone.h"
#include "ui/ozone/public/overlay_manager_ozone.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/platform_window_surface.h"
#include "ui/ozone/public/surface_factory_ozone.h"
namespace ui {
namespace {
const char kPartialPrimaryPlane[] = …;
const char kEnableOverlay[] = …;
const char kDisablePrimaryPlane[] = …;
OverlaySurfaceCandidate MakeOverlayCandidate(int z_order,
gfx::Rect bounds_rect,
gfx::RectF crop_rect) { … }
}
class SurfacelessSkiaGlRenderer::BufferWrapper { … };
SurfacelessSkiaGlRenderer::BufferWrapper::BufferWrapper() = default;
SurfacelessSkiaGlRenderer::BufferWrapper::~BufferWrapper() { … }
bool SurfacelessSkiaGlRenderer::BufferWrapper::Initialize(
GrDirectContext* gr_context,
gfx::AcceleratedWidget widget,
const gfx::Size& size) { … }
SurfacelessSkiaGlRenderer::SurfacelessSkiaGlRenderer(
gfx::AcceleratedWidget widget,
std::unique_ptr<PlatformWindowSurface> window_surface,
const scoped_refptr<gl::GLSurface>& offscreen_surface,
const scoped_refptr<gl::Presenter>& presenter,
const gfx::Size& size)
: … { … }
SurfacelessSkiaGlRenderer::~SurfacelessSkiaGlRenderer() { … }
bool SurfacelessSkiaGlRenderer::Initialize() { … }
void SurfacelessSkiaGlRenderer::RenderFrame() { … }
void SurfacelessSkiaGlRenderer::PostRenderFrameTask(
gfx::SwapCompletionResult result) { … }
}