aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private
diff options
context:
space:
mode:
Diffstat (limited to 'include/private')
-rw-r--r--include/private/SkSurfaceCharacterization.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/include/private/SkSurfaceCharacterization.h b/include/private/SkSurfaceCharacterization.h
index 9e5f40df64..48c22351b3 100644
--- a/include/private/SkSurfaceCharacterization.h
+++ b/include/private/SkSurfaceCharacterization.h
@@ -36,8 +36,7 @@ public:
enum class MipMapped : bool { kNo = false, kYes = true };
SkSurfaceCharacterization()
- : fCacheMaxResourceCount(0)
- , fCacheMaxResourceBytes(0)
+ : fCacheMaxResourceBytes(0)
, fOrigin(kBottomLeft_GrSurfaceOrigin)
, fWidth(0)
, fHeight(0)
@@ -56,9 +55,10 @@ public:
SkSurfaceCharacterization& operator=(const SkSurfaceCharacterization& other) = default;
GrContextThreadSafeProxy* contextInfo() const { return fContextInfo.get(); }
- int cacheMaxResourceCount() const { return fCacheMaxResourceCount; }
size_t cacheMaxResourceBytes() const { return fCacheMaxResourceBytes; }
+ bool isValid() const { return kUnknown_GrPixelConfig != fConfig; }
+
GrSurfaceOrigin origin() const { return fOrigin; }
int width() const { return fWidth; }
int height() const { return fHeight; }
@@ -73,9 +73,30 @@ public:
private:
friend class SkSurface_Gpu; // for 'set'
+ friend class GrContextThreadSafeProxy; // for private ctor
+
+ SkSurfaceCharacterization(sk_sp<GrContextThreadSafeProxy> contextInfo,
+ size_t cacheMaxResourceBytes,
+ GrSurfaceOrigin origin, int width, int height,
+ GrPixelConfig config, GrFSAAType FSAAType, int stencilCnt,
+ Textureable isTextureable, MipMapped isMipMapped,
+ sk_sp<SkColorSpace> colorSpace,
+ const SkSurfaceProps& surfaceProps)
+ : fContextInfo(std::move(contextInfo))
+ , fCacheMaxResourceBytes(cacheMaxResourceBytes)
+ , fOrigin(origin)
+ , fWidth(width)
+ , fHeight(height)
+ , fConfig(config)
+ , fFSAAType(FSAAType)
+ , fStencilCnt(stencilCnt)
+ , fIsTextureable(isTextureable)
+ , fIsMipMapped(isMipMapped)
+ , fColorSpace(std::move(colorSpace))
+ , fSurfaceProps(surfaceProps) {
+ }
void set(sk_sp<GrContextThreadSafeProxy> contextInfo,
- int cacheMaxResourceCount,
size_t cacheMaxResourceBytes,
GrSurfaceOrigin origin,
int width, int height,
@@ -89,7 +110,6 @@ private:
SkASSERT(MipMapped::kNo == isMipMapped || Textureable::kYes == isTextureable);
fContextInfo = contextInfo;
- fCacheMaxResourceCount = cacheMaxResourceCount;
fCacheMaxResourceBytes = cacheMaxResourceBytes;
fOrigin = origin;
@@ -105,7 +125,6 @@ private:
}
sk_sp<GrContextThreadSafeProxy> fContextInfo;
- int fCacheMaxResourceCount;
size_t fCacheMaxResourceBytes;
GrSurfaceOrigin fOrigin;
@@ -130,6 +149,8 @@ public:
, fSurfaceProps(0, kUnknown_SkPixelGeometry) {
}
+ bool isValid() const { return false; }
+
int width() const { return fWidth; }
int height() const { return fHeight; }
SkColorSpace* colorSpace() const { return fColorSpace.get(); }