#include "gpu/command_buffer/service/shared_image/skia_graphite_dawn_image_representation.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "components/viz/common/resources/shared_image_format_utils.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "gpu/command_buffer/service/dawn_context_provider.h"
#include "gpu/command_buffer/service/shared_context_state.h"
#include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/graphite/Recorder.h"
#include "third_party/skia/include/gpu/graphite/Surface.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace gpu {
namespace {
bool SupportsMultiplanarRendering(SharedContextState* context_state) { … }
bool SupportsMultiplanarCopy(SharedContextState* context_state) { … }
}
std::unique_ptr<SkiaGraphiteDawnImageRepresentation>
SkiaGraphiteDawnImageRepresentation::Create(
std::unique_ptr<DawnImageRepresentation> dawn_representation,
scoped_refptr<SharedContextState> context_state,
skgpu::graphite::Recorder* recorder,
SharedImageManager* manager,
SharedImageBacking* backing,
MemoryTypeTracker* tracker,
int array_slice) { … }
SkiaGraphiteDawnImageRepresentation::SkiaGraphiteDawnImageRepresentation(
std::unique_ptr<DawnImageRepresentation> dawn_representation,
skgpu::graphite::Recorder* recorder,
scoped_refptr<SharedContextState> context_state,
SharedImageManager* manager,
SharedImageBacking* backing,
MemoryTypeTracker* tracker,
int array_slice,
wgpu::TextureUsage supported_tex_usages)
: … { … }
SkiaGraphiteDawnImageRepresentation::~SkiaGraphiteDawnImageRepresentation() { … }
std::vector<skgpu::graphite::BackendTexture>
SkiaGraphiteDawnImageRepresentation::CreateBackendTextures(
wgpu::Texture texture,
bool readonly) { … }
std::vector<sk_sp<SkSurface>>
SkiaGraphiteDawnImageRepresentation::BeginWriteAccess(
const SkSurfaceProps& surface_props,
const gfx::Rect& update_rect) { … }
std::vector<skgpu::graphite::BackendTexture>
SkiaGraphiteDawnImageRepresentation::BeginWriteAccess() { … }
void SkiaGraphiteDawnImageRepresentation::EndWriteAccess() { … }
std::vector<skgpu::graphite::BackendTexture>
SkiaGraphiteDawnImageRepresentation::BeginReadAccess() { … }
void SkiaGraphiteDawnImageRepresentation::EndReadAccess() { … }
bool SkiaGraphiteDawnImageRepresentation::
SupportsMultipleConcurrentReadAccess() { … }
}