blob: bf2e770e31095920220ac11d73419c48cb183758 [file] [log] [blame]
Greg Daniela070ed72018-04-26 16:31:38 -04001/*
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
8#ifndef GrRenderTargetProxyPriv_DEFINED
9#define GrRenderTargetProxyPriv_DEFINED
10
Greg Danielf91aeb22019-06-18 09:58:02 -040011#include "src/gpu/GrRenderTargetProxy.h"
Greg Daniela070ed72018-04-26 16:31:38 -040012
13/**
14 * This class hides the more specialized capabilities of GrRenderTargetProxy.
15 */
16class GrRenderTargetProxyPriv {
17public:
18 void setGLRTFBOIDIs0() {
19 fRenderTargetProxy->setGLRTFBOIDIs0();
20 }
21
22 bool glRTFBOIDIs0() const {
23 return fRenderTargetProxy->glRTFBOIDIs0();
24 }
25
26private:
27 explicit GrRenderTargetProxyPriv(GrRenderTargetProxy* renderTargetProxy)
28 : fRenderTargetProxy(renderTargetProxy) {}
29 GrRenderTargetProxyPriv(const GrRenderTargetProxyPriv&) {} // unimpl
30 GrRenderTargetProxyPriv& operator=(const GrRenderTargetProxyPriv&); // unimpl
31
32 // No taking addresses of this type.
33 const GrRenderTargetProxyPriv* operator&() const;
34 GrRenderTargetProxyPriv* operator&();
35
36 GrRenderTargetProxy* fRenderTargetProxy;
37
38 friend class GrRenderTargetProxy; // to construct/copy this type.
39};
40
41inline GrRenderTargetProxyPriv GrRenderTargetProxy::rtPriv() {
42 return GrRenderTargetProxyPriv(this);
43}
44
45inline const GrRenderTargetProxyPriv GrRenderTargetProxy::rtPriv() const {
46 return GrRenderTargetProxyPriv(const_cast<GrRenderTargetProxy*>(this));
47}
48
49#endif
50