Move ccpr headers for display list out of include/private.
This partially undoes 774168efac172d096cd7f09841bce51650cb6e84 "Allow
CCPR in DDL mode (take 2)". The issue appears to have been the use of a
not fully defined type (destructor could not be instantiated) because
the private fields were also dllexported, requiring the destructors to
exist in all translation units which included the header. Only the parts
of the class which are actually public are now marked as exported.
Change-Id: I8a79bd5d8962e94c24f7563d496744bb278153fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214020
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/src/gpu/GrDrawOpAtlas.h b/src/gpu/GrDrawOpAtlas.h
index bb3a0a3..f488f6e 100644
--- a/src/gpu/GrDrawOpAtlas.h
+++ b/src/gpu/GrDrawOpAtlas.h
@@ -12,9 +12,9 @@
#include "include/core/SkSize.h"
#include "include/private/SkTDArray.h"
-#include "include/private/SkTInternalLList.h"
#include "src/core/SkGlyphRunPainter.h"
#include "src/core/SkIPoint16.h"
+#include "src/core/SkTInternalLList.h"
#include "src/gpu/ops/GrDrawOp.h"
diff --git a/src/gpu/GrOpFlushState.h b/src/gpu/GrOpFlushState.h
index e87f0d2..ad0260f 100644
--- a/src/gpu/GrOpFlushState.h
+++ b/src/gpu/GrOpFlushState.h
@@ -10,7 +10,7 @@
#include <utility>
#include "include/private/GrRenderTargetProxy.h"
-#include "include/private/SkArenaAlloc.h"
+#include "src/core/SkArenaAlloc.h"
#include "src/core/SkArenaAllocList.h"
#include "src/gpu/GrAppliedClip.h"
#include "src/gpu/GrBufferAllocPool.h"
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index e27f694..2eec472 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -12,8 +12,8 @@
#include "include/core/SkStrokeRec.h"
#include "include/core/SkTypes.h"
#include "include/private/GrOpList.h"
-#include "include/private/SkArenaAlloc.h"
#include "include/private/SkTArray.h"
+#include "src/core/SkArenaAlloc.h"
#include "src/core/SkClipStack.h"
#include "src/core/SkStringUtils.h"
#include "src/core/SkTLazy.h"
diff --git a/src/gpu/GrResourceAllocator.h b/src/gpu/GrResourceAllocator.h
index 2bb201f..668c996 100644
--- a/src/gpu/GrResourceAllocator.h
+++ b/src/gpu/GrResourceAllocator.h
@@ -12,7 +12,7 @@
#include "include/private/GrSurfaceProxy.h"
#include "src/gpu/GrGpuResourcePriv.h"
-#include "include/private/SkArenaAlloc.h"
+#include "src/core/SkArenaAlloc.h"
#include "src/core/SkTDynamicHash.h"
#include "src/core/SkTMultiMap.h"
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
index 7796b23..3734d39 100644
--- a/src/gpu/GrResourceCache.h
+++ b/src/gpu/GrResourceCache.h
@@ -13,9 +13,9 @@
#include "include/private/GrResourceKey.h"
#include "include/private/SkTArray.h"
#include "include/private/SkTHash.h"
-#include "include/private/SkTInternalLList.h"
#include "src/core/SkMessageBus.h"
#include "src/core/SkTDPQueue.h"
+#include "src/core/SkTInternalLList.h"
#include "src/core/SkTMultiMap.h"
#include "src/gpu/GrGpuResourceCacheAccess.h"
#include "src/gpu/GrGpuResourcePriv.h"
diff --git a/src/gpu/GrTRecorder.h b/src/gpu/GrTRecorder.h
index bf630fe..46e5bc3 100644
--- a/src/gpu/GrTRecorder.h
+++ b/src/gpu/GrTRecorder.h
@@ -9,8 +9,8 @@
#define GrTRecorder_DEFINED
#include "include/gpu/GrTypes.h"
-#include "include/private/SkArenaAlloc.h"
#include "include/private/SkTLogic.h"
+#include "src/core/SkArenaAlloc.h"
/**
* Records a list of items with a common base type, optional associated data, and
diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp
index 1d8c5d2..1ceed08 100644
--- a/src/gpu/GrTessellator.cpp
+++ b/src/gpu/GrTessellator.cpp
@@ -12,7 +12,7 @@
#include "src/gpu/GrVertexWriter.h"
#include "include/core/SkPath.h"
-#include "include/private/SkArenaAlloc.h"
+#include "src/core/SkArenaAlloc.h"
#include "src/core/SkGeometry.h"
#include "src/core/SkPointPriv.h"
#include "src/core/SkTDPQueue.h"
diff --git a/src/gpu/ccpr/GrCCClipPath.cpp b/src/gpu/ccpr/GrCCClipPath.cpp
index 77de299..fc73699 100644
--- a/src/gpu/ccpr/GrCCClipPath.cpp
+++ b/src/gpu/ccpr/GrCCClipPath.cpp
@@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
-#include "include/private/GrCCClipPath.h"
+#include "src/gpu/ccpr/GrCCClipPath.h"
#include "include/gpu/GrTexture.h"
#include "src/gpu/GrOnFlushResourceProvider.h"
diff --git a/src/gpu/ccpr/GrCCClipPath.h b/src/gpu/ccpr/GrCCClipPath.h
new file mode 100644
index 0000000..754c011
--- /dev/null
+++ b/src/gpu/ccpr/GrCCClipPath.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrCCClipPath_DEFINED
+#define GrCCClipPath_DEFINED
+
+#include "include/core/SkPath.h"
+#include "include/private/GrTextureProxy.h"
+
+struct GrCCPerFlushResourceSpecs;
+class GrCCAtlas;
+class GrCCPerFlushResources;
+class GrOnFlushResourceProvider;
+class GrProxyProvider;
+
+/**
+ * These are keyed by SkPath generation ID, and store which device-space paths are accessed and
+ * where by clip FPs in a given opList. A single GrCCClipPath can be referenced by multiple FPs. At
+ * flush time their coverage count masks are packed into atlas(es) alongside normal DrawPathOps.
+ */
+class GrCCClipPath {
+public:
+ GrCCClipPath() = default;
+ GrCCClipPath(const GrCCClipPath&) = delete;
+
+ ~GrCCClipPath() {
+ // Ensure no clip FP exists with a dangling pointer back into this class. This works because
+ // a clip FP will have a ref on the proxy if it exists.
+ //
+ // This assert also guarantees there won't be a lazy proxy callback with a dangling pointer
+ // back into this class, since no proxy will exist after we destruct, if the assert passes.
+ SkASSERT(!fAtlasLazyProxy || fAtlasLazyProxy->isUnique_debugOnly());
+ }
+
+ bool isInitialized() const { return fAtlasLazyProxy != nullptr; }
+ void init(const SkPath& deviceSpacePath, const SkIRect& accessRect, int rtWidth, int rtHeight,
+ const GrCaps&);
+
+ void addAccess(const SkIRect& accessRect) {
+ SkASSERT(this->isInitialized());
+ fAccessRect.join(accessRect);
+ }
+ GrTextureProxy* atlasLazyProxy() const {
+ SkASSERT(this->isInitialized());
+ return fAtlasLazyProxy.get();
+ }
+ const SkPath& deviceSpacePath() const {
+ SkASSERT(this->isInitialized());
+ return fDeviceSpacePath;
+ }
+ const SkIRect& pathDevIBounds() const {
+ SkASSERT(this->isInitialized());
+ return fPathDevIBounds;
+ }
+
+ void accountForOwnPath(GrCCPerFlushResourceSpecs*) const;
+ void renderPathInAtlas(GrCCPerFlushResources*, GrOnFlushResourceProvider*);
+
+ const SkVector& atlasScale() const { SkASSERT(fHasAtlasTransform); return fAtlasScale; }
+ const SkVector& atlasTranslate() const { SkASSERT(fHasAtlasTransform); return fAtlasTranslate; }
+
+private:
+ sk_sp<GrTextureProxy> fAtlasLazyProxy;
+ SkPath fDeviceSpacePath;
+ SkIRect fPathDevIBounds;
+ SkIRect fAccessRect;
+
+ const GrCCAtlas* fAtlas = nullptr;
+ SkIVector fDevToAtlasOffset; // Translation from device space to location in atlas.
+ SkDEBUGCODE(bool fHasAtlas = false;)
+
+ SkVector fAtlasScale;
+ SkVector fAtlasTranslate;
+ SkDEBUGCODE(bool fHasAtlasTransform = false;)
+};
+
+#endif
diff --git a/src/gpu/ccpr/GrCCClipProcessor.cpp b/src/gpu/ccpr/GrCCClipProcessor.cpp
index dbfcc04..ec3d43f 100644
--- a/src/gpu/ccpr/GrCCClipProcessor.cpp
+++ b/src/gpu/ccpr/GrCCClipProcessor.cpp
@@ -8,9 +8,9 @@
#include "src/gpu/ccpr/GrCCClipProcessor.h"
#include "include/gpu/GrTexture.h"
-#include "include/private/GrCCClipPath.h"
#include "include/private/GrTextureProxy.h"
#include "src/core/SkMakeUnique.h"
+#include "src/gpu/ccpr/GrCCClipPath.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.h b/src/gpu/ccpr/GrCCDrawPathsOp.h
index 46d03c9..85c339f 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.h
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.h
@@ -8,7 +8,7 @@
#ifndef GrCCDrawPathsOp_DEFINED
#define GrCCDrawPathsOp_DEFINED
-#include "include/private/SkTInternalLList.h"
+#include "src/core/SkTInternalLList.h"
#include "src/gpu/GrShape.h"
#include "src/gpu/ccpr/GrCCPathCache.h"
#include "src/gpu/ccpr/GrCCSTLList.h"
diff --git a/src/gpu/ccpr/GrCCPathCache.h b/src/gpu/ccpr/GrCCPathCache.h
index 17e11b4..eb8d6c5 100644
--- a/src/gpu/ccpr/GrCCPathCache.h
+++ b/src/gpu/ccpr/GrCCPathCache.h
@@ -9,8 +9,8 @@
#define GrCCPathCache_DEFINED
#include "include/private/SkTHash.h"
-#include "include/private/SkTInternalLList.h"
#include "src/core/SkExchange.h"
+#include "src/core/SkTInternalLList.h"
#include "src/gpu/GrShape.h"
#include "src/gpu/ccpr/GrCCAtlas.h"
#include "src/gpu/ccpr/GrCCPathProcessor.h"
diff --git a/src/gpu/ccpr/GrCCPerOpListPaths.h b/src/gpu/ccpr/GrCCPerOpListPaths.h
new file mode 100644
index 0000000..e0dd115
--- /dev/null
+++ b/src/gpu/ccpr/GrCCPerOpListPaths.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrCCPerOpListPaths_DEFINED
+#define GrCCPerOpListPaths_DEFINED
+
+#include "include/core/SkRefCnt.h"
+#include "src/core/SkArenaAlloc.h"
+#include "src/core/SkTInternalLList.h"
+#include "src/gpu/ccpr/GrCCClipPath.h"
+
+#include <map>
+
+class GrCCDrawPathsOp;
+class GrCCPerFlushResources;
+
+/**
+ * Tracks all the CCPR paths in a given opList that will be drawn when it flushes.
+ */
+// DDL TODO: given the usage pattern in DDL mode, this could probably be non-atomic refcounting.
+struct GrCCPerOpListPaths : public SkRefCnt {
+ SkTInternalLList<GrCCDrawPathsOp> fDrawOps; // This class does not own these ops.
+ std::map<uint32_t, GrCCClipPath> fClipPaths;
+ SkSTArenaAlloc<10 * 1024> fAllocator{10 * 1024 * 2};
+ sk_sp<const GrCCPerFlushResources> fFlushResources;
+};
+
+#endif
diff --git a/src/gpu/ccpr/GrCCSTLList.h b/src/gpu/ccpr/GrCCSTLList.h
index ef81104..eb75863 100644
--- a/src/gpu/ccpr/GrCCSTLList.h
+++ b/src/gpu/ccpr/GrCCSTLList.h
@@ -8,8 +8,8 @@
#ifndef GrCCSTLList_DEFINED
#define GrCCSTLList_DEFINED
-#include "include/private/SkArenaAlloc.h"
#include "include/private/SkNoncopyable.h"
+#include "src/core/SkArenaAlloc.h"
#include <new>
/**
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
index 83ecc8d..fe59c20 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
@@ -9,11 +9,11 @@
#define GrCoverageCountingPathRenderer_DEFINED
#include <map>
-#include "include/private/GrCCPerOpListPaths.h"
#include "src/gpu/GrOnFlushResourceProvider.h"
#include "src/gpu/GrPathRenderer.h"
#include "src/gpu/GrRenderTargetOpList.h"
#include "src/gpu/ccpr/GrCCPerFlushResources.h"
+#include "src/gpu/ccpr/GrCCPerOpListPaths.h"
class GrCCDrawPathsOp;
class GrCCPathCache;
diff --git a/src/gpu/text/GrStrikeCache.h b/src/gpu/text/GrStrikeCache.h
index a3877a0..f2fdce7 100644
--- a/src/gpu/text/GrStrikeCache.h
+++ b/src/gpu/text/GrStrikeCache.h
@@ -8,8 +8,8 @@
#ifndef GrStrikeCache_DEFINED
#define GrStrikeCache_DEFINED
-#include "include/private/SkArenaAlloc.h"
#include "src/codec/SkMasks.h"
+#include "src/core/SkArenaAlloc.h"
#include "src/core/SkStrike.h"
#include "src/core/SkTDynamicHash.h"
#include "src/gpu/GrDrawOpAtlas.h"
diff --git a/src/gpu/text/GrTextBlob.h b/src/gpu/text/GrTextBlob.h
index 3a9e2fa..b32c886 100644
--- a/src/gpu/text/GrTextBlob.h
+++ b/src/gpu/text/GrTextBlob.h
@@ -12,12 +12,12 @@
#include "include/core/SkPoint3.h"
#include "include/core/SkSurfaceProps.h"
#include "include/private/GrColor.h"
-#include "include/private/SkTInternalLList.h"
#include "src/core/SkDescriptor.h"
#include "src/core/SkMaskFilterBase.h"
#include "src/core/SkOpts.h"
#include "src/core/SkRectPriv.h"
#include "src/core/SkStrikeCache.h"
+#include "src/core/SkTInternalLList.h"
#include "src/gpu/GrDrawOpAtlas.h"
#include "src/gpu/text/GrStrikeCache.h"
#include "src/gpu/text/GrTextContext.h"
diff --git a/src/gpu/vk/GrVkResourceProvider.h b/src/gpu/vk/GrVkResourceProvider.h
index 46088f9..3df1a4d 100644
--- a/src/gpu/vk/GrVkResourceProvider.h
+++ b/src/gpu/vk/GrVkResourceProvider.h
@@ -10,9 +10,9 @@
#include "include/gpu/vk/GrVkTypes.h"
#include "include/private/SkTArray.h"
-#include "include/private/SkTInternalLList.h"
#include "src/core/SkLRUCache.h"
#include "src/core/SkTDynamicHash.h"
+#include "src/core/SkTInternalLList.h"
#include "src/gpu/GrResourceHandle.h"
#include "src/gpu/vk/GrVkDescriptorPool.h"
#include "src/gpu/vk/GrVkDescriptorSetManager.h"