#include "components/viz/service/display_embedder/skia_output_device_gl.h"
#include <tuple>
#include <utility>
#include "base/debug/alias.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "skia/ext/legacy_display_globals.h"
#include "third_party/skia/include/core/SkColorType.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkSurfaceProps.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/GrGLTypes.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_features.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface.h"
namespace viz {
namespace {
base::TimeTicks g_last_reshape_failure = …;
NOINLINE void CheckForLoopFailures() { … }
}
class SkiaOutputDeviceGL::MultiSurfaceSwapBuffersTracker { … };
SkiaOutputDeviceGL::SkiaOutputDeviceGL(
gpu::SharedContextState* context_state,
scoped_refptr<gl::GLSurface> gl_surface,
scoped_refptr<gpu::gles2::FeatureInfo> feature_info,
gpu::MemoryTracker* memory_tracker,
DidSwapBufferCompleteCallback did_swap_buffer_complete_callback)
: … { … }
SkiaOutputDeviceGL::~SkiaOutputDeviceGL() { … }
bool SkiaOutputDeviceGL::Reshape(const ReshapeParams& params) { … }
void SkiaOutputDeviceGL::Present(const std::optional<gfx::Rect>& update_rect,
BufferPresentedCallback feedback,
OutputSurfaceFrame frame) { … }
void SkiaOutputDeviceGL::DoFinishSwapBuffersAsync(
const gfx::Size& size,
OutputSurfaceFrame frame,
gfx::SwapCompletionResult result) { … }
void SkiaOutputDeviceGL::DoFinishSwapBuffers(const gfx::Size& size,
OutputSurfaceFrame frame,
gfx::SwapCompletionResult result) { … }
SkSurface* SkiaOutputDeviceGL::BeginPaint(
std::vector<GrBackendSemaphore>* end_semaphores) { … }
void SkiaOutputDeviceGL::EndPaint() { … }
}