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

Unified Diff: src/gpu/GrPathRange.h

Issue 746253003: Add IndexType parameter to GrDrawTarget::drawPaths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrPathRange.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathRange.h
diff --git a/src/gpu/GrPathRange.h b/src/gpu/GrPathRange.h
index 5bfecb0a6859fc793cd5f6979cf1b119888fe895..a1431b93c768b6598d38ecbd162800286c1d62ab 100644
--- a/src/gpu/GrPathRange.h
+++ b/src/gpu/GrPathRange.h
@@ -36,8 +36,25 @@ public:
return type;
}
+ enum PathIndexType {
+ kU8_PathIndexType, //!< uint8_t
+ kU16_PathIndexType, //!< uint16_t
+ kU32_PathIndexType, //!< uint32_t
+
+ kLast_PathIndexType = kU32_PathIndexType
+ };
+
+ static inline int PathIndexSizeInBytes(PathIndexType type) {
+ GR_STATIC_ASSERT(0 == kU8_PathIndexType);
+ GR_STATIC_ASSERT(1 == kU16_PathIndexType);
+ GR_STATIC_ASSERT(2 == kU32_PathIndexType);
+ GR_STATIC_ASSERT(kU32_PathIndexType == kLast_PathIndexType);
+
+ return 1 << type;
+ }
+
/**
- * Class that generates the paths for a specific range.
+ * Class that generates the paths for a specific range.
*/
class PathGenerator : public SkRefCnt {
public:
@@ -76,7 +93,8 @@ protected:
private:
// Notify when paths will be drawn in case this is a lazy-loaded path range.
friend class GrGpu;
- void willDrawPaths(const uint32_t indices[], int count) const;
+ void willDrawPaths(const void* indices, PathIndexType, int count) const;
+ template<typename IndexType> void willDrawPaths(const void* indices, int count) const;
mutable SkAutoTUnref<PathGenerator> fPathGenerator;
mutable SkTArray<uint8_t, true /*MEM_COPY*/> fGeneratedPaths;
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrPathRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698