Move GrProtected off GrSurfaceDesc and pass separately.
Change-Id: If628c13bb0e5aa885e4249a37432ba572e65d920
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228440
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/mock/GrMockTexture.h b/src/gpu/mock/GrMockTexture.h
index 44da34d..6a60141 100644
--- a/src/gpu/mock/GrMockTexture.h
+++ b/src/gpu/mock/GrMockTexture.h
@@ -18,14 +18,16 @@
class GrMockTexture : public GrTexture {
public:
GrMockTexture(GrMockGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
- GrMipMapsStatus mipMapsStatus, const GrMockTextureInfo& info)
- : GrMockTexture(gpu, desc, mipMapsStatus, info) {
+ GrProtected isProtected, GrMipMapsStatus mipMapsStatus,
+ const GrMockTextureInfo& info)
+ : GrMockTexture(gpu, desc, isProtected, mipMapsStatus, info) {
this->registerWithCache(budgeted);
}
- GrMockTexture(GrMockGpu* gpu, const GrSurfaceDesc& desc, GrMipMapsStatus mipMapsStatus,
- const GrMockTextureInfo& info, GrWrapCacheable cacheable, GrIOType ioType)
- : GrMockTexture(gpu, desc, mipMapsStatus, info) {
+ GrMockTexture(GrMockGpu* gpu, const GrSurfaceDesc& desc, GrProtected isProtected,
+ GrMipMapsStatus mipMapsStatus, const GrMockTextureInfo& info,
+ GrWrapCacheable cacheable, GrIOType ioType)
+ : GrMockTexture(gpu, desc, isProtected, mipMapsStatus, info) {
if (ioType == kRead_GrIOType) {
this->setReadOnly();
}
@@ -47,10 +49,10 @@
protected:
// constructor for subclasses
- GrMockTexture(GrMockGpu* gpu, const GrSurfaceDesc& desc, GrMipMapsStatus mipMapsStatus,
- const GrMockTextureInfo& info)
- : GrSurface(gpu, desc)
- , INHERITED(gpu, desc, GrTextureType::k2D, mipMapsStatus)
+ GrMockTexture(GrMockGpu* gpu, const GrSurfaceDesc& desc, GrProtected isProtected,
+ GrMipMapsStatus mipMapsStatus, const GrMockTextureInfo& info)
+ : GrSurface(gpu, desc, isProtected)
+ , INHERITED(gpu, desc, isProtected, GrTextureType::k2D, mipMapsStatus)
, fInfo(info) {}
void onRelease() override {
@@ -74,15 +76,15 @@
class GrMockRenderTarget : public GrRenderTarget {
public:
GrMockRenderTarget(GrMockGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
- const GrMockRenderTargetInfo& info)
- : GrSurface(gpu, desc), INHERITED(gpu, desc), fInfo(info) {
+ GrProtected isProtected, const GrMockRenderTargetInfo& info)
+ : GrSurface(gpu, desc, isProtected), INHERITED(gpu, desc, isProtected), fInfo(info) {
this->registerWithCache(budgeted);
}
enum Wrapped { kWrapped };
- GrMockRenderTarget(GrMockGpu* gpu, Wrapped, const GrSurfaceDesc& desc,
+ GrMockRenderTarget(GrMockGpu* gpu, Wrapped, const GrSurfaceDesc& desc, GrProtected isProtected,
const GrMockRenderTargetInfo& info)
- : GrSurface(gpu, desc), INHERITED(gpu, desc), fInfo(info) {
+ : GrSurface(gpu, desc, isProtected), INHERITED(gpu, desc, isProtected), fInfo(info) {
this->registerWithCacheWrapped(GrWrapCacheable::kNo);
}
@@ -114,9 +116,9 @@
protected:
// constructor for subclasses
- GrMockRenderTarget(GrMockGpu* gpu, const GrSurfaceDesc& desc,
+ GrMockRenderTarget(GrMockGpu* gpu, const GrSurfaceDesc& desc, GrProtected isProtected,
const GrMockRenderTargetInfo& info)
- : GrSurface(gpu, desc), INHERITED(gpu, desc), fInfo(info) {}
+ : GrSurface(gpu, desc, isProtected), INHERITED(gpu, desc, isProtected), fInfo(info) {}
private:
GrMockRenderTargetInfo fInfo;
@@ -128,21 +130,22 @@
public:
// Internally created.
GrMockTextureRenderTarget(GrMockGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
- GrMipMapsStatus mipMapsStatus, const GrMockTextureInfo& texInfo,
+ GrProtected isProtected, GrMipMapsStatus mipMapsStatus,
+ const GrMockTextureInfo& texInfo,
const GrMockRenderTargetInfo& rtInfo)
- : GrSurface(gpu, desc)
- , GrMockTexture(gpu, desc, mipMapsStatus, texInfo)
- , GrMockRenderTarget(gpu, desc, rtInfo) {
+ : GrSurface(gpu, desc, isProtected)
+ , GrMockTexture(gpu, desc, isProtected, mipMapsStatus, texInfo)
+ , GrMockRenderTarget(gpu, desc, isProtected, rtInfo) {
this->registerWithCache(budgeted);
}
// Renderable wrapped backend texture.
- GrMockTextureRenderTarget(GrMockGpu* gpu, const GrSurfaceDesc& desc,
+ GrMockTextureRenderTarget(GrMockGpu* gpu, const GrSurfaceDesc& desc, GrProtected isProtected,
GrMipMapsStatus mipMapsStatus, const GrMockTextureInfo& texInfo,
const GrMockRenderTargetInfo& rtInfo, GrWrapCacheable cacheble)
- : GrSurface(gpu, desc)
- , GrMockTexture(gpu, desc, mipMapsStatus, texInfo)
- , GrMockRenderTarget(gpu, desc, rtInfo) {
+ : GrSurface(gpu, desc, isProtected)
+ , GrMockTexture(gpu, desc, isProtected, mipMapsStatus, texInfo)
+ , GrMockRenderTarget(gpu, desc, isProtected, rtInfo) {
this->registerWithCacheWrapped(cacheble);
}