blob: 7c80099743b87f33d7ba78cf87fe3058f96575e7 [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
11#include "GrRenderTargetProxy.h"
12
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