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

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

Issue 437473002: Wrap NV_path_rendering API with GrGLPathRendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix builds more Created 6 years, 4 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/gl/GrGLPathRange.h ('k') | src/gpu/gl/GrGLPathRendering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPathRange.cpp
diff --git a/src/gpu/gl/GrGLPathRange.cpp b/src/gpu/gl/GrGLPathRange.cpp
index 2df04e3057ef0ba9d1ce66c1910010883c563c03..5e89cb5d87871941bcc40d6b59a5e9b183547607 100644
--- a/src/gpu/gl/GrGLPathRange.cpp
+++ b/src/gpu/gl/GrGLPathRange.cpp
@@ -8,17 +8,13 @@
#include "GrGLPathRange.h"
#include "GrGLPath.h"
+#include "GrGLPathRendering.h"
#include "GrGpuGL.h"
-#define GPUGL static_cast<GrGpuGL*>(this->getGpu())
-
-#define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X)
-#define GL_CALL_RET(R, X) GR_GL_CALL_RET(GPUGL->glInterface(), R, X)
-
-GrGLPathRange::GrGLPathRange(GrGpu* gpu, size_t size, const SkStrokeRec& stroke)
+GrGLPathRange::GrGLPathRange(GrGpuGL* gpu, size_t size, const SkStrokeRec& stroke)
: INHERITED(gpu, size, stroke),
+ fBasePathID(gpu->pathRendering()->genPaths(fSize)),
fNumDefinedPaths(0) {
- GL_CALL_RET(fBasePathID, GenPaths(fSize));
}
GrGLPathRange::~GrGLPathRange() {
@@ -31,15 +27,10 @@ void GrGLPathRange::initAt(size_t index, const SkPath& skPath) {
return;
}
-#ifdef SK_DEBUG
// Make sure the path at this index hasn't been initted already.
- GrGLboolean hasPathAtIndex;
- GL_CALL_RET(hasPathAtIndex, IsPath(fBasePathID + index));
- SkASSERT(GR_GL_FALSE == hasPathAtIndex);
-#endif
-
- GrGLPath::InitPathObject(gpu->glInterface(), fBasePathID + index, skPath, fStroke);
+ SkASSERT(GR_GL_FALSE == gpu->pathRendering()->isPath(fBasePathID + index));
+ GrGLPath::InitPathObject(gpu, fBasePathID + index, skPath, fStroke);
++fNumDefinedPaths;
this->didChangeGpuMemorySize();
}
@@ -48,7 +39,7 @@ void GrGLPathRange::onRelease() {
SkASSERT(NULL != this->getGpu());
if (0 != fBasePathID && !this->isWrapped()) {
- GL_CALL(DeletePaths(fBasePathID, fSize));
+ static_cast<GrGpuGL*>(this->getGpu())->pathRendering()->deletePaths(fBasePathID, fSize);
fBasePathID = 0;
}
« no previous file with comments | « src/gpu/gl/GrGLPathRange.h ('k') | src/gpu/gl/GrGLPathRendering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698