Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: src/gpu/GrDrawContextPriv.h

Issue 1754563003: Begin weaning GrClipMaskManager off of GrDrawTarget (take 2) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix fAuditTrail uses Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContextPriv.h
diff --git a/src/gpu/GrDrawContextPriv.h b/src/gpu/GrDrawContextPriv.h
new file mode 100644
index 0000000000000000000000000000000000000000..935b631a265fa26a5f502c3a319799ca5556bb1c
--- /dev/null
+++ b/src/gpu/GrDrawContextPriv.h
@@ -0,0 +1,60 @@
+/*
+ * 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 GrDrawContextPriv_DEFINED
+#define GrDrawContextPriv_DEFINED
+
+#include "GrDrawContext.h"
+
+class GrStencilSettings;
+
+/** Class that adds methods to GrDrawContext that are only intended for use internal to Skia.
+ This class is purely a privileged window into GrDrawContext. It should never have additional
+ data members or virtual methods. */
+class GrDrawContextPriv {
+public:
+ bool drawAndStencilRect(const SkIRect* scissorRect,
+ const GrStencilSettings&,
+ SkRegion::Op op,
+ bool invert,
+ bool doAA,
+ const SkMatrix& viewMatrix,
+ const SkRect&);
+
+ bool drawAndStencilPath(const SkIRect* scissorRect,
+ const GrStencilSettings&,
+ SkRegion::Op op,
+ bool invert,
+ bool doAA,
+ const SkMatrix& viewMatrix,
+ const SkPath&);
+
+ void testingOnly_drawBatch(const GrPipelineBuilder& pipelineBuilder,
+ GrDrawBatch* batch);
+
+private:
+ explicit GrDrawContextPriv(GrDrawContext* drawContext) : fDrawContext(drawContext) {}
+ GrDrawContextPriv(const GrRenderTargetPriv&) {} // unimpl
+ GrDrawContextPriv& operator=(const GrRenderTargetPriv&); // unimpl
+
+ // No taking addresses of this type.
+ const GrDrawContextPriv* operator&() const;
+ GrDrawContextPriv* operator&();
+
+ GrDrawContext* fDrawContext;
+
+ friend class GrDrawContext; // to construct/copy this type.
+};
+
+inline GrDrawContextPriv GrDrawContext::drawContextPriv() { return GrDrawContextPriv(this); }
+
+inline const GrDrawContextPriv GrDrawContext::drawContextPriv () const {
+ return GrDrawContextPriv(const_cast<GrDrawContext*>(this));
+}
+
+#endif
+
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698