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 | |
8 | #ifndef GrRenderTargetProxyPriv_DEFINED |
9 | #define GrRenderTargetProxyPriv_DEFINED |
10 | |
11 | #include "src/gpu/GrRenderTargetProxy.h" |
12 | |
13 | /** |
14 | * This class hides the more specialized capabilities of GrRenderTargetProxy. |
15 | */ |
16 | class GrRenderTargetProxyPriv { |
17 | public: |
18 | void setGLRTFBOIDIs0() { |
19 | // FBO0 should never be wrapped as a texture render target. |
20 | SkASSERT(!fRenderTargetProxy->requiresManualMSAAResolve()); |
21 | SkASSERT(!fRenderTargetProxy->asTextureProxy()); |
22 | fRenderTargetProxy->setGLRTFBOIDIs0(); |
23 | } |
24 | |
25 | bool glRTFBOIDIs0() const { |
26 | return fRenderTargetProxy->glRTFBOIDIs0(); |
27 | } |
28 | |
29 | private: |
30 | explicit GrRenderTargetProxyPriv(GrRenderTargetProxy* renderTargetProxy) |
31 | : fRenderTargetProxy(renderTargetProxy) {} |
32 | GrRenderTargetProxyPriv(const GrRenderTargetProxyPriv&) {} // unimpl |
33 | GrRenderTargetProxyPriv& operator=(const GrRenderTargetProxyPriv&); // unimpl |
34 | |
35 | // No taking addresses of this type. |
36 | const GrRenderTargetProxyPriv* operator&() const; |
37 | GrRenderTargetProxyPriv* operator&(); |
38 | |
39 | GrRenderTargetProxy* fRenderTargetProxy; |
40 | |
41 | friend class GrRenderTargetProxy; // to construct/copy this type. |
42 | }; |
43 | |
44 | inline GrRenderTargetProxyPriv GrRenderTargetProxy::rtPriv() { |
45 | return GrRenderTargetProxyPriv(this); |
46 | } |
47 | |
48 | inline const GrRenderTargetProxyPriv GrRenderTargetProxy::rtPriv() const { |
49 | return GrRenderTargetProxyPriv(const_cast<GrRenderTargetProxy*>(this)); |
50 | } |
51 | |
52 | #endif |
53 | |
54 |