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

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

Issue 443133003: Revert of Wrap NV_path_rendering API with GrGLPathRendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrGLPath.h ('k') | src/gpu/gl/GrGLPathRange.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPath.cpp
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index 6f158cdea9bc9ee4470c89d2fe10ba89e52b2a22..1c745808e986a74022b936efcf9aefe0b6b8b5a5 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -7,8 +7,12 @@
*/
#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)
namespace {
inline GrGLubyte verb_to_gl_path_cmd(SkPath::Verb verb) {
@@ -81,11 +85,10 @@
static const bool kIsWrapped = false; // The constructor creates the GL path object.
-void GrGLPath::InitPathObject(GrGpuGL* gpu,
+void GrGLPath::InitPathObject(const GrGLInterface* gl,
GrGLuint pathID,
const SkPath& skPath,
const SkStrokeRec& stroke) {
- GrGLPathRendering* pr = gpu->pathRendering();
SkSTArray<16, GrGLubyte, true> pathCommands;
SkSTArray<16, SkPoint, true> pathPoints;
@@ -106,25 +109,30 @@
}
SkASSERT(pathPoints.count() == numPts);
- pr->pathCommands(pathID, verbCnt, &pathCommands[0], 2 * pointCnt, GR_GL_FLOAT, &pathPoints[0]);
+ GR_GL_CALL(gl, PathCommands(pathID,
+ verbCnt, &pathCommands[0],
+ 2 * pointCnt, GR_GL_FLOAT, &pathPoints[0]));
+
if (stroke.needToApply()) {
SkASSERT(!stroke.isHairlineStyle());
- pr->pathParameterf(pathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stroke.getWidth()));
- pr->pathParameterf(pathID, GR_GL_PATH_MITER_LIMIT, SkScalarToFloat(stroke.getMiter()));
+ GR_GL_CALL(gl, PathParameterf(pathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stroke.getWidth())));
+ GR_GL_CALL(gl, PathParameterf(pathID, GR_GL_PATH_MITER_LIMIT, SkScalarToFloat(stroke.getMiter())));
GrGLenum join = join_to_gl_join(stroke.getJoin());
- pr->pathParameteri(pathID, GR_GL_PATH_JOIN_STYLE, join);
+ GR_GL_CALL(gl, PathParameteri(pathID, GR_GL_PATH_JOIN_STYLE, join));
GrGLenum cap = cap_to_gl_cap(stroke.getCap());
- pr->pathParameteri(pathID, GR_GL_PATH_INITIAL_END_CAP, cap);
- pr->pathParameteri(pathID, GR_GL_PATH_TERMINAL_END_CAP, cap);
+ GR_GL_CALL(gl, PathParameteri(pathID, GR_GL_PATH_INITIAL_END_CAP, cap));
+ GR_GL_CALL(gl, PathParameteri(pathID, GR_GL_PATH_TERMINAL_END_CAP, cap));
}
}
GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path, const SkStrokeRec& stroke)
- : INHERITED(gpu, kIsWrapped, path, stroke),
- fPathID(gpu->pathRendering()->genPaths(1)) {
+ : INHERITED(gpu, kIsWrapped, path, stroke) {
SkASSERT(!path.isEmpty());
- InitPathObject(gpu, fPathID, fSkPath, stroke);
+ fPathID = gpu->createGLPathObject();
+
+ InitPathObject(static_cast<GrGpuGL*>(this->getGpu())->glInterface(),
+ fPathID, fSkPath, stroke);
if (stroke.needToApply()) {
// FIXME: try to account for stroking, without rasterizing the stroke.
@@ -138,7 +146,7 @@
void GrGLPath::onRelease() {
if (0 != fPathID && !this->isWrapped()) {
- static_cast<GrGpuGL*>(this->getGpu())->pathRendering()->deletePaths(fPathID, 1);
+ static_cast<GrGpuGL*>(this->getGpu())->deleteGLPathObject(fPathID);
fPathID = 0;
}
« no previous file with comments | « src/gpu/gl/GrGLPath.h ('k') | src/gpu/gl/GrGLPathRange.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698