#include "src/gpu/ganesh/ops/AtlasPathRenderer.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPath.h"
#include "include/core/SkRect.h"
#include "include/core/SkSize.h"
#include "include/gpu/GpuTypes.h"
#include "include/gpu/ganesh/GrBackendSurface.h"
#include "include/gpu/ganesh/GrContextOptions.h"
#include "include/gpu/ganesh/GrDirectContext.h"
#include "include/gpu/ganesh/GrRecordingContext.h"
#include "include/gpu/ganesh/GrTypes.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkSpan_impl.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkMathPriv.h"
#include "src/base/SkVx.h"
#include "src/core/SkIPoint16.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrClip.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrDrawingManager.h"
#include "src/gpu/ganesh/GrDynamicAtlas.h"
#include "src/gpu/ganesh/GrPaint.h"
#include "src/gpu/ganesh/GrRecordingContextPriv.h"
#include "src/gpu/ganesh/GrRenderTargetProxy.h"
#include "src/gpu/ganesh/GrRenderTask.h"
#include "src/gpu/ganesh/GrStyle.h"
#include "src/gpu/ganesh/GrSurfaceProxy.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/GrTexture.h"
#include "src/gpu/ganesh/GrTextureProxy.h"
#include "src/gpu/ganesh/SurfaceDrawContext.h"
#include "src/gpu/ganesh/effects/GrModulateAtlasCoverageEffect.h"
#include "src/gpu/ganesh/geometry/GrStyledShape.h"
#include "src/gpu/ganesh/ops/AtlasRenderTask.h"
#include "src/gpu/ganesh/ops/DrawAtlasPathOp.h"
#include "src/gpu/ganesh/ops/GrOp.h"
#include "src/gpu/ganesh/ops/TessellationPathRenderer.h"
#include <algorithm>
#include <utility>
usingnamespaceskia_private;
namespace {
std::pair<skvx::float2, skvx::float2> round_out(const SkRect& r) { … }
template<typename T> bool refs_atlas(const T* proxyOwner, const GrSurfaceProxy* atlasProxy) { … }
bool is_visible(const SkRect& pathDevBounds, const SkIRect& clipBounds) { … }
#ifdef SK_DEBUG
void validate_atlas_dependencies(
const TArray<sk_sp<skgpu::ganesh::AtlasRenderTask>>& atlasTasks) { … }
#endif
}
namespace skgpu::ganesh {
constexpr static auto kAtlasAlpha8Type = …;
constexpr static int kAtlasInitialSize = …;
constexpr static auto kAtlasAlgorithm = …;
constexpr static int kAtlasMaxPathHeight = …;
constexpr static int kAtlasMaxPathHeightWithMSAAFallback = …;
constexpr static int kAtlasMaxPathWidth = …;
bool AtlasPathRenderer::IsSupported(GrRecordingContext* rContext) { … }
sk_sp<AtlasPathRenderer> AtlasPathRenderer::Make(GrRecordingContext* rContext) { … }
AtlasPathRenderer::AtlasPathRenderer(GrDirectContext* dContext) { … }
bool AtlasPathRenderer::pathFitsInAtlas(const SkRect& pathDevBounds,
GrAAType fallbackAAType) const { … }
void AtlasPathRenderer::AtlasPathKey::set(const SkMatrix& m, const SkPath& path) { … }
bool AtlasPathRenderer::addPathToAtlas(GrRecordingContext* rContext,
const SkMatrix& viewMatrix,
const SkPath& path,
const SkRect& pathDevBounds,
SkIRect* devIBounds,
SkIPoint16* locationInAtlas,
bool* transposedInAtlas,
const DrawRefsAtlasCallback& drawRefsAtlasCallback) { … }
PathRenderer::CanDrawPath AtlasPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { … }
bool AtlasPathRenderer::onDrawPath(const DrawPathArgs& args) { … }
GrFPResult AtlasPathRenderer::makeAtlasClipEffect(const SurfaceDrawContext* sdc,
const GrOp* opBeingClipped,
std::unique_ptr<GrFragmentProcessor> inputFP,
const SkIRect& drawBounds,
const SkMatrix& viewMatrix,
const SkPath& path) { … }
bool AtlasPathRenderer::preFlush(GrOnFlushResourceProvider* onFlushRP) { … }
}