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

Unified Diff: src/gpu/gl/GrGLPathRange.h

Issue 400713003: Add a GrPathRange class (Closed) Base URL: https://skia.googlesource.com/skia.git@clupload-ispath
Patch Set: Fix more windows trivial warningswq Created 6 years, 5 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
Index: src/gpu/gl/GrGLPathRange.h
diff --git a/src/gpu/gl/GrGLPathRange.h b/src/gpu/gl/GrGLPathRange.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c6b78e0163db5b52a45c9bda7a9ec54f56e656d
--- /dev/null
+++ b/src/gpu/gl/GrGLPathRange.h
@@ -0,0 +1,48 @@
+
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLPathRange_DEFINED
+#define GrGLPathRange_DEFINED
+
+#include "../GrPathRange.h"
+#include "gl/GrGLFunctions.h"
+
+class GrGpuGL;
+
+/**
+ * Currently this represents a range of GL_NV_path_rendering Path IDs. If we
+ * support other GL path extensions then this would have to have a type enum
+ * and/or be subclassed.
+ */
+
+class GrGLPathRange : public GrPathRange {
+public:
+ GrGLPathRange(GrGpu*, size_t size, const SkStrokeRec&);
+ virtual ~GrGLPathRange();
+
+ GrGLuint basePathID() const { return fBasePathID; }
+
+ virtual void initAt(size_t index, const SkPath&);
+
+ // TODO: Use a better approximation for the individual path sizes.
+ virtual size_t gpuMemorySize() const SK_OVERRIDE {
+ return 100 * fNumDefinedPaths;
+ }
+
+protected:
+ virtual void onRelease() SK_OVERRIDE;
+ virtual void onAbandon() SK_OVERRIDE;
+
+private:
+ GrGLuint fBasePathID;
+ size_t fNumDefinedPaths;
+
+ typedef GrPathRange INHERITED;
+};
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698