Move SkDeferredDisplayList.h into include\core
Clients will need official access to this class for the compilation iterator. This CL also hides some of the cruft we don't want exposed. Bug: skia:9455 Change-Id: I408c19f9ecd6880a5a7853def591407b0ca43e4e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272343 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
a973365512
commit
ad3b2c9886
@ -25,6 +25,7 @@ skia_core_public = [
|
||||
"$_include/core/SkCubicMap.h",
|
||||
"$_include/core/SkData.h",
|
||||
"$_include/core/SkDataTable.h",
|
||||
"$_include/core/SkDeferredDisplayList.h",
|
||||
"$_include/core/SkDeferredDisplayListRecorder.h",
|
||||
"$_include/core/SkDocument.h",
|
||||
"$_include/core/SkDrawLooper.h",
|
||||
@ -460,7 +461,6 @@ skia_core_sources = [
|
||||
"$_include/private/SkChecksum.h",
|
||||
"$_include/private/SkColorData.h",
|
||||
"$_include/private/SkDDLTmpRedirect.h",
|
||||
"$_include/private/SkDeferredDisplayList.h",
|
||||
"$_include/private/SkDeque.h",
|
||||
"$_include/private/SkFixed.h",
|
||||
"$_include/private/SkFloatBits.h",
|
||||
|
@ -18,38 +18,16 @@ class SkDeferredDisplayListPriv;
|
||||
#include "include/private/GrRecordingContext.h"
|
||||
#include "include/private/SkTArray.h"
|
||||
#include <map>
|
||||
class GrOpMemoryPool;
|
||||
class GrRenderTask;
|
||||
class GrRenderTargetProxy;
|
||||
struct GrCCPerOpsTaskPaths;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This class contains pre-processed gpu operations that can be replayed into
|
||||
* an SkSurface via draw(SkDeferredDisplayList*).
|
||||
*
|
||||
* TODO: we probably need to expose this class so users can query it for memory usage.
|
||||
* an SkSurface via SkSurface::draw(SkDeferredDisplayList*).
|
||||
*/
|
||||
class SkDeferredDisplayList {
|
||||
public:
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
// This object is the source from which the lazy proxy backing the DDL will pull its backing
|
||||
// texture when the DDL is replayed. It has to be separately ref counted bc the lazy proxy
|
||||
// can outlive the DDL.
|
||||
class SK_API LazyProxyData : public SkRefCnt {
|
||||
public:
|
||||
// Upon being replayed - this field will be filled in (by the DrawingManager) with the
|
||||
// proxy backing the destination SkSurface. Note that, since there is no good place to
|
||||
// clear it, it can become a dangling pointer.
|
||||
GrRenderTargetProxy* fReplayDest = nullptr;
|
||||
};
|
||||
#else
|
||||
class SK_API LazyProxyData : public SkRefCnt {};
|
||||
#endif
|
||||
|
||||
SK_API SkDeferredDisplayList(const SkSurfaceCharacterization& characterization,
|
||||
sk_sp<LazyProxyData>);
|
||||
SK_API ~SkDeferredDisplayList();
|
||||
|
||||
SK_API const SkSurfaceCharacterization& characterization() const {
|
||||
@ -61,16 +39,21 @@ public:
|
||||
const SkDeferredDisplayListPriv priv() const;
|
||||
|
||||
private:
|
||||
#if SK_SUPPORT_GPU
|
||||
SK_API const SkTArray<GrRecordingContext::ProgramData>& programData() const {
|
||||
return fProgramData;
|
||||
}
|
||||
#endif
|
||||
|
||||
friend class GrDrawingManager; // for access to 'fRenderTasks', 'fLazyProxyData', 'fArenas'
|
||||
friend class SkDeferredDisplayListRecorder; // for access to 'fLazyProxyData'
|
||||
friend class SkDeferredDisplayListPriv;
|
||||
|
||||
class LazyProxyData;
|
||||
|
||||
SK_API SkDeferredDisplayList(const SkSurfaceCharacterization& characterization,
|
||||
sk_sp<LazyProxyData>);
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
const SkTArray<GrRecordingContext::ProgramData>& programData() const {
|
||||
return fProgramData;
|
||||
}
|
||||
#endif
|
||||
|
||||
const SkSurfaceCharacterization fCharacterization;
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
@ -84,8 +67,8 @@ private:
|
||||
SkTArray<sk_sp<GrRenderTask>> fRenderTasks;
|
||||
|
||||
SkTArray<GrRecordingContext::ProgramData> fProgramData;
|
||||
#endif
|
||||
sk_sp<LazyProxyData> fLazyProxyData;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
@ -8,11 +8,11 @@
|
||||
#ifndef SkDeferredDisplayListRecorder_DEFINED
|
||||
#define SkDeferredDisplayListRecorder_DEFINED
|
||||
|
||||
#include "include/core/SkDeferredDisplayList.h"
|
||||
#include "include/core/SkImageInfo.h"
|
||||
#include "include/core/SkRefCnt.h"
|
||||
#include "include/core/SkSurfaceCharacterization.h"
|
||||
#include "include/core/SkTypes.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
|
||||
class GrBackendFormat;
|
||||
class GrBackendTexture;
|
||||
|
@ -10,6 +10,6 @@
|
||||
|
||||
// A client is directly referencing include/private/SkDeferredDisplayList.h. This temporary
|
||||
// header is required to move them over to referencing include/core/SkDeferredDisplayList.h.
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "include/core/SkDeferredDisplayList.h"
|
||||
|
||||
#endif
|
||||
|
@ -5,9 +5,10 @@
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "src/core/SkDeferredDisplayListPriv.h"
|
||||
|
||||
#include "include/core/SkRefCnt.h"
|
||||
#include "include/core/SkTypes.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "src/core/SkArenaAlloc.h"
|
||||
#include <utility>
|
||||
class SkSurfaceCharacterization;
|
||||
@ -20,8 +21,10 @@ class SkSurfaceCharacterization;
|
||||
SkDeferredDisplayList::SkDeferredDisplayList(const SkSurfaceCharacterization& characterization,
|
||||
sk_sp<LazyProxyData> lazyProxyData)
|
||||
: fCharacterization(characterization)
|
||||
, fLazyProxyData(std::move(lazyProxyData)) {
|
||||
#if SK_SUPPORT_GPU
|
||||
, fLazyProxyData(std::move(lazyProxyData))
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
SkDeferredDisplayList::~SkDeferredDisplayList() {
|
||||
}
|
||||
SkDeferredDisplayList::~SkDeferredDisplayList() {}
|
||||
|
@ -8,32 +8,44 @@
|
||||
#ifndef SkDeferredDisplayListPriv_DEFINED
|
||||
#define SkDeferredDisplayListPriv_DEFINED
|
||||
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "include/core/SkDeferredDisplayList.h"
|
||||
class GrRenderTargetProxy;
|
||||
|
||||
/*************************************************************************************************/
|
||||
|
||||
// This object is the source from which the lazy proxy backing the DDL will pull its backing
|
||||
// texture when the DDL is replayed. It has to be separately ref counted bc the lazy proxy
|
||||
// can outlive the DDL.
|
||||
class SkDeferredDisplayList::LazyProxyData : public SkRefCnt {
|
||||
#if SK_SUPPORT_GPU
|
||||
public:
|
||||
// Upon being replayed - this field will be filled in (by the DrawingManager) with the
|
||||
// proxy backing the destination SkSurface. Note that, since there is no good place to
|
||||
// clear it, it can become a dangling pointer.
|
||||
GrRenderTargetProxy* fReplayDest = nullptr;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*************************************************************************************************/
|
||||
/** Class that adds methods to SkDeferredDisplayList that are only intended for use internal to Skia.
|
||||
This class is purely a privileged window into SkDeferredDisplayList. It should never have
|
||||
additional data members or virtual methods. */
|
||||
class SkDeferredDisplayListPriv {
|
||||
public:
|
||||
int numRenderTasks() const {
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
int numRenderTasks() const {
|
||||
return fDDL->fRenderTasks.count();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
const SkDeferredDisplayList::LazyProxyData* lazyProxyData() const {
|
||||
#if SK_SUPPORT_GPU
|
||||
return fDDL->fLazyProxyData.get();
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
const SkTArray<GrRecordingContext::ProgramData>& programData() const {
|
||||
return fDDL->programData();
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
explicit SkDeferredDisplayListPriv(SkDeferredDisplayList* ddl) : fDDL(ddl) {}
|
||||
|
@ -6,9 +6,10 @@
|
||||
*/
|
||||
|
||||
#include "include/core/SkDeferredDisplayListRecorder.h"
|
||||
|
||||
#include "include/core/SkSurface.h"
|
||||
#include "include/core/SkSurfaceCharacterization.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "src/core/SkDeferredDisplayListPriv.h"
|
||||
#include "src/core/SkMessageBus.h"
|
||||
|
||||
#if !SK_SUPPORT_GPU
|
||||
|
@ -7,9 +7,9 @@
|
||||
|
||||
#include "include/gpu/GrContext.h"
|
||||
|
||||
#include "include/core/SkDeferredDisplayList.h"
|
||||
#include "include/core/SkTraceMemoryDump.h"
|
||||
#include "include/gpu/GrBackendSemaphore.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "include/private/SkImageInfoPriv.h"
|
||||
#include "src/core/SkMipMap.h"
|
||||
#include "src/core/SkTaskGroup.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "include/gpu/GrBackendSemaphore.h"
|
||||
#include "include/gpu/GrTexture.h"
|
||||
#include "include/private/GrRecordingContext.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "src/core/SkDeferredDisplayListPriv.h"
|
||||
#include "src/core/SkTTopoSort.h"
|
||||
#include "src/gpu/GrAuditTrail.h"
|
||||
#include "src/gpu/GrClientMappedBufferManager.h"
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
#include "src/gpu/vk/GrVkSecondaryCBDrawContext.h"
|
||||
|
||||
#include "include/core/SkDeferredDisplayList.h"
|
||||
#include "include/core/SkImageInfo.h"
|
||||
#include "include/core/SkSurfaceCharacterization.h"
|
||||
#include "include/gpu/GrContext.h"
|
||||
#include "include/gpu/vk/GrVkTypes.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "src/core/SkSurfacePriv.h"
|
||||
#include "src/gpu/GrContextPriv.h"
|
||||
#include "src/gpu/GrContextThreadSafeProxyPriv.h"
|
||||
|
@ -6,11 +6,11 @@
|
||||
*/
|
||||
|
||||
#include "include/core/SkCanvas.h"
|
||||
#include "include/core/SkDeferredDisplayList.h"
|
||||
#include "include/core/SkSurfaceCharacterization.h"
|
||||
#include "include/gpu/GrBackendSurface.h"
|
||||
#include "include/gpu/GrTexture.h"
|
||||
#include "include/private/GrRecordingContext.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "src/core/SkImagePriv.h"
|
||||
#include "src/gpu/GrAHardwareBufferUtils.h"
|
||||
#include "src/gpu/GrCaps.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "include/core/SkCanvas.h"
|
||||
#include "include/core/SkColor.h"
|
||||
#include "include/core/SkColorSpace.h"
|
||||
#include "include/core/SkDeferredDisplayList.h"
|
||||
#include "include/core/SkDeferredDisplayListRecorder.h"
|
||||
#include "include/core/SkImage.h"
|
||||
#include "include/core/SkImageInfo.h"
|
||||
@ -26,7 +27,6 @@
|
||||
#include "include/gpu/GrTypes.h"
|
||||
#include "include/gpu/gl/GrGLTypes.h"
|
||||
#include "include/private/GrTypesPriv.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "src/core/SkDeferredDisplayListPriv.h"
|
||||
#include "src/gpu/GrCaps.h"
|
||||
#include "src/gpu/GrContextPriv.h"
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "include/core/SkCanvas.h"
|
||||
#include "include/core/SkDeferredDisplayList.h"
|
||||
#include "include/core/SkGraphics.h"
|
||||
#include "include/core/SkPicture.h"
|
||||
#include "include/core/SkPictureRecorder.h"
|
||||
@ -13,7 +14,6 @@
|
||||
#include "include/core/SkSurface.h"
|
||||
#include "include/core/SkSurfaceProps.h"
|
||||
#include "include/effects/SkPerlinNoiseShader.h"
|
||||
#include "include/private/SkDeferredDisplayList.h"
|
||||
#include "src/core/SkOSFile.h"
|
||||
#include "src/core/SkTaskGroup.h"
|
||||
#include "src/gpu/GrCaps.h"
|
||||
|
Loading…
Reference in New Issue
Block a user