skia2/src/gpu/GrRenderTargetProxyPriv.h
Jim Van Verth 5fab90999f Revert "Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal."
This reverts commit b1edfde279.

Reason for revert: senorblanco@ is adding a WriteOnly flag which will
be more appropriate for this functionality.

Original change's description:
> Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal.
> 
> This provides a way to indicate that a Metal RenderTarget, and in
> particular a RenderTargetProxy, is framebufferOnly, so it can be
> restricted to certain operations.
> 
> Bug: skia:9573
> TBR: bsalomon@google.com
> Change-Id: I733fae2fce402c375534889346255afe28a57944
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255783
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,robertphillips@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:9573
Change-Id: Ide775fbbe81114c10fe81e7faa517c20784e8498
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256496
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-11-25 21:49:46 +00:00

54 lines
1.5 KiB
C++

/*
* 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 "src/gpu/GrRenderTargetProxy.h"
/**
* This class hides the more specialized capabilities of GrRenderTargetProxy.
*/
class GrRenderTargetProxyPriv {
public:
void setGLRTFBOIDIs0() {
// FBO0 should never be wrapped as a texture render target.
SkASSERT(!fRenderTargetProxy->requiresManualMSAAResolve());
SkASSERT(!fRenderTargetProxy->asTextureProxy());
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