aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/GrSurfaceProxy.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-21 12:13:37 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-21 17:04:18 +0000
commitabf7b763e2c1ba069942dedec914494817fd27a8 (patch)
treec956480efd2273f0371823d3ebf0a3af46c09cab /include/private/GrSurfaceProxy.h
parente65a5cd3fc34ab90743056ace2ef0a3a01bf6346 (diff)
Add texture-specific flags for External & Rectangle textures
For DDLs, Ganesh needs to know about External & Rectangle textures prior to instantiation (or PromiseImage fulfillment). These new flags allow the client to provide this information when the lazyProxy is created. The new texture flags work analogously to the render target flags: GrSurface and GrSurfaceProxy get a new set of accessors for the new flags The new flags are set appropriately on a GrGLTexture when it is created For wrapped texture proxies the flags are just copied off of the GrSurface For lazy-proxies/promise-images the flags are computed up front and passed to the proxy The GrSurfaceProxy/GrSurface flags equivalence is verified in GrSurfaceProxy::assign Change-Id: Ia8e1998aa0a36ce4481bfd9e56be21f990e83148 Reviewed-on: https://skia-review.googlesource.com/114985 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/private/GrSurfaceProxy.h')
-rw-r--r--include/private/GrSurfaceProxy.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 0b1507969e..3c503faeb8 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -420,6 +420,20 @@ protected:
bool instantiateImpl(GrResourceProvider* resourceProvider, int sampleCnt, bool needsStencil,
GrSurfaceDescFlags descFlags, GrMipMapped, const GrUniqueKey*);
+ void setDoesNotSupportMipMaps() {
+ SkASSERT(this->asTextureProxy());
+ fSurfaceFlags |= GrInternalSurfaceFlags::kDoesNotSupportMipMaps;
+ }
+ bool doesNotSupportMipMaps() const {
+ return fSurfaceFlags & GrInternalSurfaceFlags::kDoesNotSupportMipMaps;
+ }
+
+ void setIsClampOnly() {
+ SkASSERT(this->asTextureProxy());
+ fSurfaceFlags |= GrInternalSurfaceFlags::kIsClampOnly;
+ }
+ bool isClampOnly() const { return fSurfaceFlags & GrInternalSurfaceFlags::kIsClampOnly; }
+
void setHasMixedSamples() {
SkASSERT(this->asRenderTargetProxy());
fSurfaceFlags |= GrInternalSurfaceFlags::kMixedSampled;