diff options
author | Robert Phillips <robertphillips@google.com> | 2017-09-28 09:00:45 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-28 13:23:37 +0000 |
commit | 420c4cfcd75189c03c735b1f02dee360e705c3e9 (patch) | |
tree | cd44358721970b357f77c542504e53f2397c0b1f /src/gpu/GrTextureProxyPriv.h | |
parent | 36dcd7f25d1ffee8571a7d424eb02f60cd474fa7 (diff) |
Add GrTextureProxyPriv
Several upcoming additions should go in here
Change-Id: I642f3c7cc36b1e6512ee0170640449e88a666d2c
Reviewed-on: https://skia-review.googlesource.com/52661
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrTextureProxyPriv.h')
-rw-r--r-- | src/gpu/GrTextureProxyPriv.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gpu/GrTextureProxyPriv.h b/src/gpu/GrTextureProxyPriv.h new file mode 100644 index 0000000000..c3ddb9460c --- /dev/null +++ b/src/gpu/GrTextureProxyPriv.h @@ -0,0 +1,39 @@ +/* + * Copyright 2017 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrTextureProxyPriv_DEFINED +#define GrTextureProxyPriv_DEFINED + +#include "GrTextureProxy.h" + +/** + * This class hides the more specialized capabilities of GrTextureProxy. + */ +class GrTextureProxyPriv { +public: + +private: + explicit GrTextureProxyPriv(GrTextureProxy* textureProxy) : fTextureProxy(textureProxy) {} + GrTextureProxyPriv(const GrTextureProxyPriv&) {} // unimpl + GrTextureProxyPriv& operator=(const GrTextureProxyPriv&); // unimpl + + // No taking addresses of this type. + const GrTextureProxyPriv* operator&() const; + GrTextureProxyPriv* operator&(); + + GrTextureProxy* fTextureProxy; + + friend class GrTextureProxy; // to construct/copy this type. +}; + +inline GrTextureProxyPriv GrTextureProxy::texPriv() { return GrTextureProxyPriv(this); } + +inline const GrTextureProxyPriv GrTextureProxy::texPriv() const { + return GrTextureProxyPriv(const_cast<GrTextureProxy*>(this)); +} + +#endif |