Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3bdc3f5

Browse files
bsalomonSkia Commit-Bot
authored andcommitted
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>
1 parent ea0f8f1 commit 3bdc3f5

File tree

9 files changed

+23
-25
lines changed

9 files changed

+23
-25
lines changed

gn/gpu.gni

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ skia_gpu_sources = [
1616
"$_include/gpu/GrContextOptions.h",
1717
"$_include/gpu/GrContext.h",
1818
"$_include/gpu/GrDriverBugWorkarounds.h",
19-
"$_include/gpu/GrGpuResource.h",
20-
"$_include/gpu/GrRenderTarget.h",
21-
"$_include/gpu/GrResourceKey.h",
22-
"$_include/gpu/GrSurface.h",
2319
"$_include/gpu/GrTexture.h",
24-
"$_include/gpu/GrSamplerState.h",
2520
"$_include/gpu/GrTypes.h",
2621

2722
"$_include/gpu/gl/GrGLAssembleInterface.h",
@@ -36,10 +31,14 @@ skia_gpu_sources = [
3631
"$_include/private/GrColor.h",
3732
"$_include/private/GrCCClipPath.h",
3833
"$_include/private/GrCCPerOpListPaths.h",
34+
"$_include/private/GrGpuResource.h",
3935
"$_include/private/GrOpList.h",
4036
"$_include/private/GrProxyRef.h",
4137
"$_include/private/GrSingleOwner.h",
4238
"$_include/private/GrRenderTargetProxy.h",
39+
"$_include/private/GrResourceKey.h",
40+
"$_include/private/GrSamplerState.h",
41+
"$_include/private/GrSurface.h",
4342
"$_include/private/GrSurfaceProxy.h",
4443
"$_include/private/GrTextureProxy.h",
4544
"$_include/private/GrTypesPriv.h",
@@ -153,6 +152,7 @@ skia_gpu_sources = [
153152
"$_src/gpu/GrRenderTargetProxyPriv.h",
154153
"$_src/gpu/GrReducedClip.cpp",
155154
"$_src/gpu/GrReducedClip.h",
155+
"$_src/gpu/GrRenderTarget.h",
156156
"$_src/gpu/GrRenderTargetContext.cpp",
157157
"$_src/gpu/GrRenderTargetContext.h",
158158
"$_src/gpu/GrRenderTargetContextPriv.h",

include/gpu/GrTexture.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99
#ifndef GrTexture_DEFINED
1010
#define GrTexture_DEFINED
1111

12+
#include "../private/GrSurface.h"
13+
#include "../private/GrTypesPriv.h"
1214
#include "GrBackendSurface.h"
13-
#include "GrSamplerState.h"
14-
#include "GrSurface.h"
1515
#include "SkImage.h"
1616
#include "SkPoint.h"
1717
#include "SkRefCnt.h"
18-
#include "../private/GrTypesPriv.h"
1918

2019
class GrTexturePriv;
2120

include/gpu/GrGpuResource.h renamed to include/private/GrGpuResource.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ template <typename DERIVED> class GrIORef : public SkNoncopyable {
7777
}
7878

7979
protected:
80-
GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) { }
80+
GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) {}
8181

8282
enum CntType {
8383
kRef_CntType,
@@ -95,7 +95,7 @@ template <typename DERIVED> class GrIORef : public SkNoncopyable {
9595
bool internalHasUniqueRef() const { return fRefCnt == 1; }
9696

9797
private:
98-
friend class GrIORefProxy; // needs to forward on wrapped IO calls
98+
friend class GrIORefProxy; // needs to forward on wrapped IO calls
9999
// This is for a unit test.
100100
template <typename T>
101101
friend void testingOnly_getIORefCnts(const T*, int* refCnt, int* readCnt, int* writeCnt);
@@ -133,7 +133,7 @@ template <typename DERIVED> class GrIORef : public SkNoncopyable {
133133
mutable int32_t fPendingReads;
134134
mutable int32_t fPendingWrites;
135135

136-
friend class GrResourceCache; // to check IO ref counts.
136+
friend class GrResourceCache; // to check IO ref counts.
137137

138138
template <typename, GrIOType> friend class GrPendingIOResource;
139139
};
@@ -143,7 +143,6 @@ template <typename DERIVED> class GrIORef : public SkNoncopyable {
143143
*/
144144
class SK_API GrGpuResource : public GrIORef<GrGpuResource> {
145145
public:
146-
147146
/**
148147
* Tests whether a object has been abandoned or released. All objects will
149148
* be in this state after their creating GrContext is destroyed or has
@@ -275,11 +274,11 @@ class SK_API GrGpuResource : public GrIORef<GrGpuResource> {
275274
GrGpu* getGpu() const { return fGpu; }
276275

277276
/** Overridden to free GPU resources in the backend API. */
278-
virtual void onRelease() { }
277+
virtual void onRelease() {}
279278
/** Overridden to abandon any internal handles, ptrs, etc to backend API resources.
280279
This may be called when the underlying 3D context is no longer valid and so no
281280
backend API calls should be made. */
282-
virtual void onAbandon() { }
281+
virtual void onAbandon() {}
283282

284283
/**
285284
* Allows subclasses to add additional backing information to the SkTraceMemoryDump.
@@ -299,15 +298,14 @@ class SK_API GrGpuResource : public GrIORef<GrGpuResource> {
299298
void dumpMemoryStatisticsPriv(SkTraceMemoryDump* traceMemoryDump, const SkString& resourceName,
300299
const char* type, size_t size) const;
301300

302-
303301
private:
304302
/**
305303
* Called by the registerWithCache if the resource is available to be used as scratch.
306304
* Resource subclasses should override this if the instances should be recycled as scratch
307305
* resources and populate the scratchKey with the key.
308306
* By default resources are not recycled as scratch.
309307
**/
310-
virtual void computeScratchKey(GrScratchKey*) const { }
308+
virtual void computeScratchKey(GrScratchKey*) const {}
311309

312310
/**
313311
* Frees the object in the underlying 3D API. Called by CacheAccess.
@@ -352,7 +350,7 @@ class SK_API GrGpuResource : public GrIORef<GrGpuResource> {
352350
const UniqueID fUniqueID;
353351

354352
typedef GrIORef<GrGpuResource> INHERITED;
355-
friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and notifyRefCntIsZero.
353+
friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and notifyRefCntIsZero.
356354
};
357355

358356
#endif

include/gpu/GrResourceKey.h renamed to include/private/GrResourceKey.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class GrResourceKey {
155155
SkASSERT(SkIsAlign4(this->internalSize()));
156156
}
157157

158-
friend class TestResource; // For unit test to access kMetaDataCnt.
158+
friend class TestResource; // For unit test to access kMetaDataCnt.
159159

160160
// bmp textures require 5 uint32_t values.
161161
SkAutoSTMalloc<kMetaDataCnt + 5, uint32_t> fKey;
@@ -218,7 +218,7 @@ class GrScratchKey : public GrResourceKey {
218218
class Builder : public INHERITED::Builder {
219219
public:
220220
Builder(GrScratchKey* key, ResourceType type, int data32Count)
221-
: INHERITED::Builder(key, type, data32Count) {}
221+
: INHERITED::Builder(key, type, data32Count) {}
222222
};
223223
};
224224

@@ -330,7 +330,7 @@ class GrUniqueKey : public GrResourceKey {
330330
name##_once(gr_init_static_unique_key_once, &name##_storage); \
331331
static const GrUniqueKey& name = *reinterpret_cast<GrUniqueKey*>(name##_storage.get())
332332

333-
static inline void gr_init_static_unique_key_once(SkAlignedSTStorage<1,GrUniqueKey>* keyStorage) {
333+
static inline void gr_init_static_unique_key_once(SkAlignedSTStorage<1, GrUniqueKey>* keyStorage) {
334334
GrUniqueKey* key = new (keyStorage->get()) GrUniqueKey;
335335
GrUniqueKey::Builder builder(key, GrUniqueKey::GenerateDomain(), 0);
336336
}
File renamed without changes.

include/gpu/GrSurface.h renamed to include/private/GrSurface.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ class SK_API GrSurface : public GrGpuResource {
112112
, fConfig(desc.fConfig)
113113
, fWidth(desc.fWidth)
114114
, fHeight(desc.fHeight)
115-
, fSurfaceFlags(GrInternalSurfaceFlags::kNone) {
116-
}
115+
, fSurfaceFlags(GrInternalSurfaceFlags::kNone) {}
117116

118117
~GrSurface() override {}
119118

include/gpu/GrRenderTarget.h renamed to src/gpu/GrRenderTarget.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GrRenderTarget : virtual public GrSurface {
3030

3131
// GrSurface overrides
3232
GrRenderTarget* asRenderTarget() override { return this; }
33-
const GrRenderTarget* asRenderTarget() const override { return this; }
33+
const GrRenderTarget* asRenderTarget() const override { return this; }
3434

3535
// GrRenderTarget
3636
bool isStencilBufferMultisampled() const { return fSampleCnt > 1; }
@@ -125,10 +125,10 @@ class GrRenderTarget : virtual public GrSurface {
125125

126126
friend class GrRenderTargetPriv;
127127

128-
int fSampleCnt;
128+
int fSampleCnt;
129129
sk_sp<GrStencilAttachment> fStencilAttachment;
130130

131-
SkIRect fResolveRect;
131+
SkIRect fResolveRect;
132132

133133
typedef GrSurface INHERITED;
134134
};

src/gpu/GrTexturePriv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#ifndef GrTexturePriv_DEFINED
99
#define GrTexturePriv_DEFINED
1010

11+
#include "GrSamplerState.h"
1112
#include "GrTexture.h"
1213

1314
/** Class that adds methods to GrTexture that are only intended for use internal to Skia.

tools/fiddle/fiddle_main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ DEFINE_double(frame, 1.0, "A double value in [0, 1] that specifies the point in
2323
#include "GrBackendSurface.h"
2424
#include "GrContextPriv.h"
2525
#include "GrGpu.h"
26+
#include "GrRenderTarget.h"
2627
#include "gl/GLTestContext.h"
2728

2829
// Globals externed in fiddle_main.h

0 commit comments

Comments
 (0)