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

Unified Diff: src/gpu/GrReducedClip.h

Issue 653393003: Cleanup: Turn GrReducedClip into a class with a static function. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix very long lines Created 6 years, 2 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/GrClipMaskManager.cpp ('k') | src/gpu/GrReducedClip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrReducedClip.h
diff --git a/src/gpu/GrReducedClip.h b/src/gpu/GrReducedClip.h
index e3a28cc0c573810db13522c3397aa34aaae41248..21899c73aae73d1f6cfc7abb51a970a92b436354 100644
--- a/src/gpu/GrReducedClip.h
+++ b/src/gpu/GrReducedClip.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2012 Google Inc.
*
@@ -12,37 +11,39 @@
#include "SkClipStack.h"
#include "SkTLList.h"
-namespace GrReducedClip {
-
-typedef SkTLList<SkClipStack::Element> ElementList;
-
-enum InitialState {
- kAllIn_InitialState,
- kAllOut_InitialState,
+class SK_API GrReducedClip {
+public:
+ typedef SkTLList<SkClipStack::Element> ElementList;
+
+ enum InitialState {
+ kAllIn_InitialState,
+ kAllOut_InitialState,
+ };
+
+ /**
+ * This function takes a clip stack and a query rectangle and it produces a
+ * reduced set of SkClipStack::Elements that are equivalent to applying the
+ * full stack to the rectangle. The clip stack generation id that represents
+ * the list of elements is returned in resultGenID. The initial state of the
+ * query rectangle before the first clip element is applied is returned via
+ * initialState. Optionally, the caller can request a tighter bounds on the
+ * clip be returned via tighterBounds. If not NULL, tighterBounds will
+ * always be contained by queryBounds after return. If tighterBounds is
+ * specified then it is assumed that the caller will implicitly clip against
+ * it. If the caller specifies non-NULL for requiresAA then it will indicate
+ * whether anti-aliasing is required to process any of the elements in the
+ * result.
+ *
+ * This may become a member function of SkClipStack when its interface is
+ * determined to be stable.
+ */
+ static void ReduceClipStack(const SkClipStack& stack,
+ const SkIRect& queryBounds,
+ ElementList* result,
+ int32_t* resultGenID,
+ InitialState* initialState,
+ SkIRect* tighterBounds = NULL,
+ bool* requiresAA = NULL);
};
-/**
- * This function takes a clip stack and a query rectangle and it produces a reduced set of
- * SkClipStack::Elements that are equivalent to applying the full stack to the rectangle. The clip
- * stack generation id that represents the list of elements is returned in resultGenID. The
- * initial state of the query rectangle before the first clip element is applied is returned via
- * initialState. Optionally, the caller can request a tighter bounds on the clip be returned via
- * tighterBounds. If not NULL, tighterBounds will always be contained by queryBounds after return.
- * If tighterBounds is specified then it is assumed that the caller will implicitly clip against it.
- * If the caller specifies non-NULL for requiresAA then it will indicate whether anti-aliasing is
- * required to process any of the elements in the result.
- *
- * This may become a member function of SkClipStack when its interface is determined to be stable.
- * Marked SK_API so that SkLua can call this in a shared library build.
- */
-SK_API void ReduceClipStack(const SkClipStack& stack,
- const SkIRect& queryBounds,
- ElementList* result,
- int32_t* resultGenID,
- InitialState* initialState,
- SkIRect* tighterBounds = NULL,
- bool* requiresAA = NULL);
-
-} // namespace GrReducedClip
-
#endif
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrReducedClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698