GrRenderTargetProxyPriv.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2018 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef GrRenderTargetProxyPriv_DEFINED
  8. #define GrRenderTargetProxyPriv_DEFINED
  9. #include "src/gpu/GrRenderTargetProxy.h"
  10. /**
  11. * This class hides the more specialized capabilities of GrRenderTargetProxy.
  12. */
  13. class GrRenderTargetProxyPriv {
  14. public:
  15. void setGLRTFBOIDIs0() {
  16. fRenderTargetProxy->setGLRTFBOIDIs0();
  17. }
  18. bool glRTFBOIDIs0() const {
  19. return fRenderTargetProxy->glRTFBOIDIs0();
  20. }
  21. private:
  22. explicit GrRenderTargetProxyPriv(GrRenderTargetProxy* renderTargetProxy)
  23. : fRenderTargetProxy(renderTargetProxy) {}
  24. GrRenderTargetProxyPriv(const GrRenderTargetProxyPriv&) {} // unimpl
  25. GrRenderTargetProxyPriv& operator=(const GrRenderTargetProxyPriv&); // unimpl
  26. // No taking addresses of this type.
  27. const GrRenderTargetProxyPriv* operator&() const;
  28. GrRenderTargetProxyPriv* operator&();
  29. GrRenderTargetProxy* fRenderTargetProxy;
  30. friend class GrRenderTargetProxy; // to construct/copy this type.
  31. };
  32. inline GrRenderTargetProxyPriv GrRenderTargetProxy::rtPriv() {
  33. return GrRenderTargetProxyPriv(this);
  34. }
  35. inline const GrRenderTargetProxyPriv GrRenderTargetProxy::rtPriv() const {
  36. return GrRenderTargetProxyPriv(const_cast<GrRenderTargetProxy*>(this));
  37. }
  38. #endif