aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
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/gpu
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/gpu')
-rw-r--r--include/gpu/GrContext.h4
-rw-r--r--include/gpu/GrSurface.h8
2 files changed, 11 insertions, 1 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index e8f8acc3cf..1acd30c127 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -388,13 +388,15 @@ public:
* with this characterization will be replayed into
* @param isMipMapped Will the surface the DDL will be replayed into have space
* allocated for mipmaps?
+ * @param willUseGLFBO0 Will the surface the DDL will be replayed into be backed by GL
+ * FBO 0. This flag is only valid if using an GL backend.
*/
SkSurfaceCharacterization createCharacterization(
size_t cacheMaxResourceBytes,
const SkImageInfo& ii, const GrBackendFormat& backendFormat,
int sampleCount, GrSurfaceOrigin origin,
const SkSurfaceProps& surfaceProps,
- bool isMipMapped);
+ bool isMipMapped, bool willUseGLFBO0 = false);
const GrCaps* caps() const { return fCaps.get(); }
sk_sp<const GrCaps> refCaps() const { return fCaps; }
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 46d3945de4..4ddc5d14cc 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -91,6 +91,14 @@ protected:
return fSurfaceFlags & GrInternalSurfaceFlags::kWindowRectsSupport;
}
+ void setGLRTFBOIDIs0() {
+ SkASSERT(this->asRenderTarget());
+ fSurfaceFlags |= GrInternalSurfaceFlags::kGLRTFBOIDIs0;
+ }
+ bool glRTFBOIDis0() const {
+ return fSurfaceFlags & GrInternalSurfaceFlags::kGLRTFBOIDIs0;
+ }
+
// Methods made available via GrSurfacePriv
bool hasPendingRead() const;
bool hasPendingWrite() const;