1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SKIA_OUTPUT_SURFACE_DEPENDENCY_IMPL_H_
#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SKIA_OUTPUT_SURFACE_DEPENDENCY_IMPL_H_
#include <memory>
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "components/viz/service/display_embedder/skia_output_surface_dependency.h"
namespace base {
class SingleThreadTaskRunner;
}
namespace viz {
class GpuServiceImpl;
class VIZ_SERVICE_EXPORT SkiaOutputSurfaceDependencyImpl
: public SkiaOutputSurfaceDependency {
public:
SkiaOutputSurfaceDependencyImpl(
GpuServiceImpl* gpu_service_impl,
gpu::SurfaceHandle surface_handle);
SkiaOutputSurfaceDependencyImpl(const SkiaOutputSurfaceDependencyImpl&) =
delete;
SkiaOutputSurfaceDependencyImpl& operator=(
const SkiaOutputSurfaceDependencyImpl&) = delete;
~SkiaOutputSurfaceDependencyImpl() override;
std::unique_ptr<gpu::SingleTaskSequence> CreateSequence() override;
gpu::SharedImageManager* GetSharedImageManager() override;
gpu::SyncPointManager* GetSyncPointManager() override;
const gpu::GpuDriverBugWorkarounds& GetGpuDriverBugWorkarounds() override;
scoped_refptr<gpu::SharedContextState> GetSharedContextState() override;
gpu::raster::GrShaderCache* GetGrShaderCache() override;
VulkanContextProvider* GetVulkanContextProvider() override;
gpu::DawnContextProvider* GetDawnContextProvider() override;
const gpu::GpuPreferences& GetGpuPreferences() const override;
const gpu::GpuFeatureInfo& GetGpuFeatureInfo() override;
bool IsOffscreen() override;
gpu::SurfaceHandle GetSurfaceHandle() override;
scoped_refptr<gl::GLSurface> CreateGLSurface(
gl::GLSurfaceFormat format) override;
scoped_refptr<gl::Presenter> CreatePresenter() override;
#if BUILDFLAG(IS_ANDROID)
base::ScopedClosureRunner CachePresenter(gl::Presenter* presenter) override;
base::ScopedClosureRunner CacheGLSurface(gl::GLSurface* surface) override;
#endif
scoped_refptr<base::SingleThreadTaskRunner> GetClientTaskRunner() override;
void ScheduleGrContextCleanup() override;
void ScheduleDelayedGPUTaskFromGPUThread(base::OnceClosure task) override;
void DidLoseContext(gpu::error::ContextLostReason reason,
const GURL& active_url) override;
bool NeedsSupportForExternalStencil() override;
bool IsUsingCompositorGpuThread() override;
private:
const raw_ptr<GpuServiceImpl> gpu_service_impl_;
const gpu::SurfaceHandle surface_handle_;
scoped_refptr<base::SingleThreadTaskRunner> client_thread_task_runner_;
};
} // namespace viz
#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SKIA_OUTPUT_SURFACE_DEPENDENCY_IMPL_H_
|