Revert "Move some Gr headers from include/gpu to include/private and src/gpu."
This reverts commit 3bdc3f5f9c0bf62c1eb7932f67f9f4838782a36a.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Move some Gr headers from include/gpu to include/private and src/gpu.
>
> Bug: skia:
> Change-Id: I341dd3bff63cc99d3be830e21673073645a9cfec
> Reviewed-on: https://skia-review.googlesource.com/c/176220
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: Ia7082f66abb969b20dd5d1f12c3c8d09cd84c241
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/176587
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/gn/gpu.gni b/gn/gpu.gni
index bfe8dc7..915e06f 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -16,7 +16,12 @@
"$_include/gpu/GrContextOptions.h",
"$_include/gpu/GrContext.h",
"$_include/gpu/GrDriverBugWorkarounds.h",
+ "$_include/gpu/GrGpuResource.h",
+ "$_include/gpu/GrRenderTarget.h",
+ "$_include/gpu/GrResourceKey.h",
+ "$_include/gpu/GrSurface.h",
"$_include/gpu/GrTexture.h",
+ "$_include/gpu/GrSamplerState.h",
"$_include/gpu/GrTypes.h",
"$_include/gpu/gl/GrGLAssembleInterface.h",
@@ -31,14 +36,10 @@
"$_include/private/GrColor.h",
"$_include/private/GrCCClipPath.h",
"$_include/private/GrCCPerOpListPaths.h",
- "$_include/private/GrGpuResource.h",
"$_include/private/GrOpList.h",
"$_include/private/GrProxyRef.h",
"$_include/private/GrSingleOwner.h",
"$_include/private/GrRenderTargetProxy.h",
- "$_include/private/GrResourceKey.h",
- "$_include/private/GrSamplerState.h",
- "$_include/private/GrSurface.h",
"$_include/private/GrSurfaceProxy.h",
"$_include/private/GrTextureProxy.h",
"$_include/private/GrTypesPriv.h",
@@ -152,7 +153,6 @@
"$_src/gpu/GrRenderTargetProxyPriv.h",
"$_src/gpu/GrReducedClip.cpp",
"$_src/gpu/GrReducedClip.h",
- "$_src/gpu/GrRenderTarget.h",
"$_src/gpu/GrRenderTargetContext.cpp",
"$_src/gpu/GrRenderTargetContext.h",
"$_src/gpu/GrRenderTargetContextPriv.h",
diff --git a/include/private/GrGpuResource.h b/include/gpu/GrGpuResource.h
similarity index 96%
rename from include/private/GrGpuResource.h
rename to include/gpu/GrGpuResource.h
index 3df4dec..7f57cdd 100644
--- a/include/private/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -77,7 +77,7 @@
}
protected:
- GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) {}
+ GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) { }
enum CntType {
kRef_CntType,
@@ -95,7 +95,7 @@
bool internalHasUniqueRef() const { return fRefCnt == 1; }
private:
- friend class GrIORefProxy; // needs to forward on wrapped IO calls
+ friend class GrIORefProxy; // needs to forward on wrapped IO calls
// This is for a unit test.
template <typename T>
friend void testingOnly_getIORefCnts(const T*, int* refCnt, int* readCnt, int* writeCnt);
@@ -133,7 +133,7 @@
mutable int32_t fPendingReads;
mutable int32_t fPendingWrites;
- friend class GrResourceCache; // to check IO ref counts.
+ friend class GrResourceCache; // to check IO ref counts.
template <typename, GrIOType> friend class GrPendingIOResource;
};
@@ -143,6 +143,7 @@
*/
class SK_API GrGpuResource : public GrIORef<GrGpuResource> {
public:
+
/**
* Tests whether a object has been abandoned or released. All objects will
* be in this state after their creating GrContext is destroyed or has
@@ -274,11 +275,11 @@
GrGpu* getGpu() const { return fGpu; }
/** Overridden to free GPU resources in the backend API. */
- virtual void onRelease() {}
+ virtual void onRelease() { }
/** Overridden to abandon any internal handles, ptrs, etc to backend API resources.
This may be called when the underlying 3D context is no longer valid and so no
backend API calls should be made. */
- virtual void onAbandon() {}
+ virtual void onAbandon() { }
/**
* Allows subclasses to add additional backing information to the SkTraceMemoryDump.
@@ -298,6 +299,7 @@
void dumpMemoryStatisticsPriv(SkTraceMemoryDump* traceMemoryDump, const SkString& resourceName,
const char* type, size_t size) const;
+
private:
/**
* Called by the registerWithCache if the resource is available to be used as scratch.
@@ -305,7 +307,7 @@
* resources and populate the scratchKey with the key.
* By default resources are not recycled as scratch.
**/
- virtual void computeScratchKey(GrScratchKey*) const {}
+ virtual void computeScratchKey(GrScratchKey*) const { }
/**
* Frees the object in the underlying 3D API. Called by CacheAccess.
@@ -350,7 +352,7 @@
const UniqueID fUniqueID;
typedef GrIORef<GrGpuResource> INHERITED;
- friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and notifyRefCntIsZero.
+ friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and notifyRefCntIsZero.
};
#endif
diff --git a/src/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
similarity index 96%
rename from src/gpu/GrRenderTarget.h
rename to include/gpu/GrRenderTarget.h
index d01df95..32c6225 100644
--- a/src/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -30,7 +30,7 @@
// GrSurface overrides
GrRenderTarget* asRenderTarget() override { return this; }
- const GrRenderTarget* asRenderTarget() const override { return this; }
+ const GrRenderTarget* asRenderTarget() const override { return this; }
// GrRenderTarget
bool isStencilBufferMultisampled() const { return fSampleCnt > 1; }
@@ -125,10 +125,10 @@
friend class GrRenderTargetPriv;
- int fSampleCnt;
+ int fSampleCnt;
sk_sp<GrStencilAttachment> fStencilAttachment;
- SkIRect fResolveRect;
+ SkIRect fResolveRect;
typedef GrSurface INHERITED;
};
diff --git a/include/private/GrResourceKey.h b/include/gpu/GrResourceKey.h
similarity index 98%
rename from include/private/GrResourceKey.h
rename to include/gpu/GrResourceKey.h
index 97f2860..006fae8 100644
--- a/include/private/GrResourceKey.h
+++ b/include/gpu/GrResourceKey.h
@@ -155,7 +155,7 @@
SkASSERT(SkIsAlign4(this->internalSize()));
}
- friend class TestResource; // For unit test to access kMetaDataCnt.
+ friend class TestResource; // For unit test to access kMetaDataCnt.
// bmp textures require 5 uint32_t values.
SkAutoSTMalloc<kMetaDataCnt + 5, uint32_t> fKey;
@@ -218,7 +218,7 @@
class Builder : public INHERITED::Builder {
public:
Builder(GrScratchKey* key, ResourceType type, int data32Count)
- : INHERITED::Builder(key, type, data32Count) {}
+ : INHERITED::Builder(key, type, data32Count) {}
};
};
@@ -330,7 +330,7 @@
name##_once(gr_init_static_unique_key_once, &name##_storage); \
static const GrUniqueKey& name = *reinterpret_cast<GrUniqueKey*>(name##_storage.get())
-static inline void gr_init_static_unique_key_once(SkAlignedSTStorage<1, GrUniqueKey>* keyStorage) {
+static inline void gr_init_static_unique_key_once(SkAlignedSTStorage<1,GrUniqueKey>* keyStorage) {
GrUniqueKey* key = new (keyStorage->get()) GrUniqueKey;
GrUniqueKey::Builder builder(key, GrUniqueKey::GenerateDomain(), 0);
}
diff --git a/include/private/GrSamplerState.h b/include/gpu/GrSamplerState.h
similarity index 100%
rename from include/private/GrSamplerState.h
rename to include/gpu/GrSamplerState.h
diff --git a/include/private/GrSurface.h b/include/gpu/GrSurface.h
similarity index 98%
rename from include/private/GrSurface.h
rename to include/gpu/GrSurface.h
index c629617..3211a1e 100644
--- a/include/private/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -112,7 +112,8 @@
, fConfig(desc.fConfig)
, fWidth(desc.fWidth)
, fHeight(desc.fHeight)
- , fSurfaceFlags(GrInternalSurfaceFlags::kNone) {}
+ , fSurfaceFlags(GrInternalSurfaceFlags::kNone) {
+ }
~GrSurface() override {}
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index 9c1b7db..df2f542 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -9,12 +9,13 @@
#ifndef GrTexture_DEFINED
#define GrTexture_DEFINED
-#include "../private/GrSurface.h"
-#include "../private/GrTypesPriv.h"
#include "GrBackendSurface.h"
+#include "GrSamplerState.h"
+#include "GrSurface.h"
#include "SkImage.h"
#include "SkPoint.h"
#include "SkRefCnt.h"
+#include "../private/GrTypesPriv.h"
class GrTexturePriv;
diff --git a/src/gpu/GrTexturePriv.h b/src/gpu/GrTexturePriv.h
index 5a0b514..ee767bf 100644
--- a/src/gpu/GrTexturePriv.h
+++ b/src/gpu/GrTexturePriv.h
@@ -8,7 +8,6 @@
#ifndef GrTexturePriv_DEFINED
#define GrTexturePriv_DEFINED
-#include "GrSamplerState.h"
#include "GrTexture.h"
/** Class that adds methods to GrTexture that are only intended for use internal to Skia.
diff --git a/tools/fiddle/fiddle_main.cpp b/tools/fiddle/fiddle_main.cpp
index 32a2fb2..1a5ad3c 100644
--- a/tools/fiddle/fiddle_main.cpp
+++ b/tools/fiddle/fiddle_main.cpp
@@ -23,7 +23,6 @@
#include "GrBackendSurface.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
-#include "GrRenderTarget.h"
#include "gl/GLTestContext.h"
// Globals externed in fiddle_main.h