diff options
author | Greg Daniel <egdaniel@google.com> | 2018-04-26 16:31:38 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-26 21:44:43 +0000 |
commit | a070ed7fccd8bc9c5f314e1a4ac090c497862836 (patch) | |
tree | ecc4a4e13087343c756472d77385f46b20149653 /src/gpu/GrRenderTargetProxyPriv.h | |
parent | 848271111d6982fc0666fb195da1d9d8d279746e (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 'src/gpu/GrRenderTargetProxyPriv.h')
-rw-r--r-- | src/gpu/GrRenderTargetProxyPriv.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/gpu/GrRenderTargetProxyPriv.h b/src/gpu/GrRenderTargetProxyPriv.h new file mode 100644 index 0000000000..7c80099743 --- /dev/null +++ b/src/gpu/GrRenderTargetProxyPriv.h @@ -0,0 +1,50 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrRenderTargetProxyPriv_DEFINED +#define GrRenderTargetProxyPriv_DEFINED + +#include "GrRenderTargetProxy.h" + +/** + * This class hides the more specialized capabilities of GrRenderTargetProxy. + */ +class GrRenderTargetProxyPriv { +public: + void setGLRTFBOIDIs0() { + fRenderTargetProxy->setGLRTFBOIDIs0(); + } + + bool glRTFBOIDIs0() const { + return fRenderTargetProxy->glRTFBOIDIs0(); + } + +private: + explicit GrRenderTargetProxyPriv(GrRenderTargetProxy* renderTargetProxy) + : fRenderTargetProxy(renderTargetProxy) {} + GrRenderTargetProxyPriv(const GrRenderTargetProxyPriv&) {} // unimpl + GrRenderTargetProxyPriv& operator=(const GrRenderTargetProxyPriv&); // unimpl + + // No taking addresses of this type. + const GrRenderTargetProxyPriv* operator&() const; + GrRenderTargetProxyPriv* operator&(); + + GrRenderTargetProxy* fRenderTargetProxy; + + friend class GrRenderTargetProxy; // to construct/copy this type. +}; + +inline GrRenderTargetProxyPriv GrRenderTargetProxy::rtPriv() { + return GrRenderTargetProxyPriv(this); +} + +inline const GrRenderTargetProxyPriv GrRenderTargetProxy::rtPriv() const { + return GrRenderTargetProxyPriv(const_cast<GrRenderTargetProxy*>(this)); +} + +#endif + |