aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-04-26 16:31:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-26 21:44:43 +0000
commita070ed7fccd8bc9c5f314e1a4ac090c497862836 (patch)
treeecc4a4e13087343c756472d77385f46b20149653 /include/core
parent848271111d6982fc0666fb195da1d9d8d279746e (diff)
Add InternalSurfaceFlag so we know if RenderTargetProxys and RenderTargets use GL FBO 0.
Bug: skia:7748 Change-Id: I2fda3cde12ccdef19fe06ff287a8024b58d28ef0 Reviewed-on: https://skia-review.googlesource.com/124048 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkSurfaceCharacterization.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/core/SkSurfaceCharacterization.h b/include/core/SkSurfaceCharacterization.h
index 797e5e4717..e8efdcf2a9 100644
--- a/include/core/SkSurfaceCharacterization.h
+++ b/include/core/SkSurfaceCharacterization.h
@@ -30,6 +30,7 @@ class SK_API SkSurfaceCharacterization {
public:
enum class Textureable : bool { kNo = false, kYes = true };
enum class MipMapped : bool { kNo = false, kYes = true };
+ enum class UsesGLFBO0 : bool { kNo = false, kYes = true };
SkSurfaceCharacterization()
: fCacheMaxResourceBytes(0)
@@ -39,6 +40,7 @@ public:
, fStencilCnt(0)
, fIsTextureable(Textureable::kYes)
, fIsMipMapped(MipMapped::kYes)
+ , fUsesGLFBO0(UsesGLFBO0::kNo)
, fSurfaceProps(0, kUnknown_SkPixelGeometry) {
}
@@ -67,7 +69,7 @@ public:
fCacheMaxResourceBytes,
fImageInfo.makeWH(width, height),
fOrigin, fConfig, fFSAAType, fStencilCnt,
- fIsTextureable, fIsMipMapped,
+ fIsTextureable, fIsMipMapped, fUsesGLFBO0,
fSurfaceProps);
}
@@ -86,6 +88,7 @@ public:
int stencilCount() const { return fStencilCnt; }
bool isTextureable() const { return Textureable::kYes == fIsTextureable; }
bool isMipMapped() const { return MipMapped::kYes == fIsMipMapped; }
+ bool usesGLFBO0() const { return UsesGLFBO0::kYes == fUsesGLFBO0; }
SkColorSpace* colorSpace() const { return fImageInfo.colorSpace(); }
sk_sp<SkColorSpace> refColorSpace() const { return fImageInfo.refColorSpace(); }
const SkSurfaceProps& surfaceProps()const { return fSurfaceProps; }
@@ -105,6 +108,7 @@ private:
GrPixelConfig config,
GrFSAAType FSAAType, int stencilCnt,
Textureable isTextureable, MipMapped isMipMapped,
+ UsesGLFBO0 usesGLFBO0,
const SkSurfaceProps& surfaceProps)
: fContextInfo(std::move(contextInfo))
, fCacheMaxResourceBytes(cacheMaxResourceBytes)
@@ -115,6 +119,7 @@ private:
, fStencilCnt(stencilCnt)
, fIsTextureable(isTextureable)
, fIsMipMapped(isMipMapped)
+ , fUsesGLFBO0(usesGLFBO0)
, fSurfaceProps(surfaceProps) {
}
@@ -127,8 +132,10 @@ private:
int stencilCnt,
Textureable isTextureable,
MipMapped isMipMapped,
+ UsesGLFBO0 usesGLFBO0,
const SkSurfaceProps& surfaceProps) {
SkASSERT(MipMapped::kNo == isMipMapped || Textureable::kYes == isTextureable);
+ SkASSERT(Textureable::kNo == isTextureable || UsesGLFBO0::kNo == usesGLFBO0);
fContextInfo = contextInfo;
fCacheMaxResourceBytes = cacheMaxResourceBytes;
@@ -140,6 +147,7 @@ private:
fStencilCnt = stencilCnt;
fIsTextureable = isTextureable;
fIsMipMapped = isMipMapped;
+ fUsesGLFBO0 = usesGLFBO0;
fSurfaceProps = surfaceProps;
}
@@ -153,6 +161,7 @@ private:
int fStencilCnt;
Textureable fIsTextureable;
MipMapped fIsMipMapped;
+ UsesGLFBO0 fUsesGLFBO0;
SkSurfaceProps fSurfaceProps;
};
@@ -180,6 +189,7 @@ public:
int stencilCount() const { return 0; }
bool isTextureable() const { return false; }
bool isMipMapped() const { return false; }
+ bool usesGLFBO0() const { return false; }
SkColorSpace* colorSpace() const { return nullptr; }
sk_sp<SkColorSpace> refColorSpace() const { return nullptr; }
const SkSurfaceProps& surfaceProps()const { return fSurfaceProps; }