aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetContextPriv.h
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-10-27 14:47:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-27 19:14:09 +0000
commit1105224f9701e57ec5ce0354d6a380b664f5c638 (patch)
tree2b6f3db0bfd99da5e22adabc0da37d9271c8b543 /src/gpu/GrRenderTargetContextPriv.h
parent6e74412a9cf1ffa44271a55b42f18e8a0813a0a2 (diff)
Rename GrDrawContext to GrRenderTargetContext
This is in preparation for GrTextureContext and GrSurfaceContext BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4030 Change-Id: Ie58c93052e68f3f1f5fe8d15d63760de274a6fbd Reviewed-on: https://skia-review.googlesource.com/4030 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetContextPriv.h')
-rw-r--r--src/gpu/GrRenderTargetContextPriv.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/gpu/GrRenderTargetContextPriv.h b/src/gpu/GrRenderTargetContextPriv.h
new file mode 100644
index 0000000000..82792dd7da
--- /dev/null
+++ b/src/gpu/GrRenderTargetContextPriv.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrRenderTargetContextPriv_DEFINED
+#define GrRenderTargetContextPriv_DEFINED
+
+#include "GrRenderTargetContext.h"
+#include "GrRenderTargetOpList.h"
+#include "GrPathRendering.h"
+
+class GrFixedClip;
+class GrPath;
+struct GrUserStencilSettings;
+
+/** Class that adds methods to GrRenderTargetContext that are only intended for use internal to
+ Skia. This class is purely a privileged window into GrRenderTargetContext. It should never have
+ additional data members or virtual methods. */
+class GrRenderTargetContextPriv {
+public:
+ gr_instanced::InstancedRendering* accessInstancedRendering() const {
+ return fRenderTargetContext->getOpList()->instancedRendering();
+ }
+
+ void clear(const GrFixedClip&, const GrColor, bool canIgnoreClip);
+
+ void clearStencilClip(const GrFixedClip&, bool insideStencilMask);
+
+ void stencilRect(const GrClip& clip,
+ const GrUserStencilSettings* ss,
+ bool useHWAA,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect);
+
+ void stencilPath(const GrClip&,
+ bool useHWAA,
+ const SkMatrix& viewMatrix,
+ const GrPath*);
+
+ bool drawAndStencilRect(const GrClip&,
+ const GrUserStencilSettings*,
+ SkRegion::Op op,
+ bool invert,
+ bool doAA,
+ const SkMatrix& viewMatrix,
+ const SkRect&);
+
+ bool drawAndStencilPath(const GrClip&,
+ const GrUserStencilSettings*,
+ SkRegion::Op op,
+ bool invert,
+ bool doAA,
+ const SkMatrix& viewMatrix,
+ const SkPath&);
+
+ SkBudgeted isBudgeted() const;
+
+ void testingOnly_drawBatch(const GrPaint&,
+ GrDrawBatch* batch,
+ const GrUserStencilSettings* = nullptr,
+ bool snapToCenters = false);
+
+private:
+ explicit GrRenderTargetContextPriv(GrRenderTargetContext* renderTargetContext)
+ : fRenderTargetContext(renderTargetContext) {}
+ GrRenderTargetContextPriv(const GrRenderTargetPriv&) {} // unimpl
+ GrRenderTargetContextPriv& operator=(const GrRenderTargetPriv&); // unimpl
+
+ // No taking addresses of this type.
+ const GrRenderTargetContextPriv* operator&() const;
+ GrRenderTargetContextPriv* operator&();
+
+ GrRenderTargetContext* fRenderTargetContext;
+
+ friend class GrRenderTargetContext; // to construct/copy this type.
+};
+
+inline GrRenderTargetContextPriv GrRenderTargetContext::renderTargetContextPriv() {
+ return GrRenderTargetContextPriv(this);
+}
+
+inline const GrRenderTargetContextPriv GrRenderTargetContext::renderTargetContextPriv () const {
+ return GrRenderTargetContextPriv(const_cast<GrRenderTargetContext*>(this));
+}
+
+#endif