aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurfaceProxyPriv.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-01-25 15:48:30 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-25 21:23:28 +0000
commit757914d26b337b04cf270875bce28d7d1e2407de (patch)
tree7c47dffdcbc62d476cdbacbc34b7bfb24410fcaf /src/gpu/GrSurfaceProxyPriv.h
parentb2cd1d7b442b689ff74409029defbf505c044b2c (diff)
Switch GrConfigConversionEffect over to taking GrTextureProxies
Change-Id: Ic8be773e210e1ac05dcb9aad6c89dcd63e9e4ba2 Reviewed-on: https://skia-review.googlesource.com/7521 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxyPriv.h')
-rw-r--r--src/gpu/GrSurfaceProxyPriv.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/gpu/GrSurfaceProxyPriv.h b/src/gpu/GrSurfaceProxyPriv.h
new file mode 100644
index 0000000000..19b81712e1
--- /dev/null
+++ b/src/gpu/GrSurfaceProxyPriv.h
@@ -0,0 +1,43 @@
+/*
+ * 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 GrSurfaceProxyPriv_DEFINED
+#define GrSurfaceProxyPriv_DEFINED
+
+#include "GrSurfaceProxy.h"
+
+/** Class that adds methods to GrSurfaceProxy that are only intended for use internal to Skia.
+ This class is purely a privileged window into GrSurfaceProxy. It should never have additional
+ data members or virtual methods. */
+class GrSurfaceProxyPriv {
+public:
+ // Beware! This call is only guaranteed to tell you if the proxy in question has
+ // any pending IO in its current state. It won't tell you about the IO state in the
+ // future when the proxy is actually used/instantiated.
+ bool hasPendingIO() const { return fProxy->hasPendingIO(); }
+
+private:
+ explicit GrSurfaceProxyPriv(GrSurfaceProxy* proxy) : fProxy(proxy) {}
+ GrSurfaceProxyPriv(const GrSurfaceProxyPriv&) {} // unimpl
+ GrSurfaceProxyPriv& operator=(const GrSurfaceProxyPriv&); // unimpl
+
+ // No taking addresses of this type.
+ const GrSurfaceProxyPriv* operator&() const;
+ GrSurfaceProxyPriv* operator&();
+
+ GrSurfaceProxy* fProxy;
+
+ friend class GrSurfaceProxy; // to construct/copy this type.
+};
+
+inline GrSurfaceProxyPriv GrSurfaceProxy::priv() { return GrSurfaceProxyPriv(this); }
+
+inline const GrSurfaceProxyPriv GrSurfaceProxy::priv () const {
+ return GrSurfaceProxyPriv(const_cast<GrSurfaceProxy*>(this));
+}
+
+#endif