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

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

Issue 26557003: Add a GPU paths to resource cache of the context (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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/gl/GrGLPath.h ('k') | no next file » | 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 c85644e311379abc7308264c33936c56632b14c3..a749e410bd1909e1094f590a1bca38265e93029d 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -8,7 +8,6 @@
#include "GrGLPath.h"
#include "GrGpuGL.h"
-#include "SkStrokeRec.h"
#define GPUGL static_cast<GrGpuGL*>(this->getGpu())
@@ -87,7 +86,7 @@ inline GrGLenum cap_to_gl_cap(SkPaint::Cap cap) {
static const bool kIsWrapped = false; // The constructor creates the GL path object.
GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path, const SkStrokeRec& stroke)
- : INHERITED(gpu, kIsWrapped, stroke) {
+ : INHERITED(gpu, kIsWrapped, path, stroke) {
#ifndef SK_SCALAR_IS_FLOAT
GrCrash("Assumes scalar is float.");
#endif
@@ -98,14 +97,14 @@ GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path, const SkStrokeRec& stroke)
SkSTArray<16, GrGLubyte, true> pathCommands;
SkSTArray<16, SkPoint, true> pathPoints;
- int verbCnt = path.countVerbs();
- int pointCnt = path.countPoints();
+ int verbCnt = fSkPath.countVerbs();
+ int pointCnt = fSkPath.countPoints();
pathCommands.resize_back(verbCnt);
pathPoints.resize_back(pointCnt);
// TODO: Direct access to path points since we could pass them on directly.
- path.getPoints(&pathPoints[0], pointCnt);
- path.getVerbs(&pathCommands[0], verbCnt);
+ fSkPath.getPoints(&pathPoints[0], pointCnt);
+ fSkPath.getVerbs(&pathCommands[0], verbCnt);
SkDEBUGCODE(int numPts = 0);
for (int i = 0; i < verbCnt; ++i) {
@@ -118,7 +117,6 @@ GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path, const SkStrokeRec& stroke)
GL_CALL(PathCommands(fPathID,
verbCnt, &pathCommands[0],
2 * pointCnt, GR_GL_FLOAT, &pathPoints[0]));
- fBounds = path.getBounds();
if (stroke.needToApply()) {
GL_CALL(PathParameterf(fPathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stroke.getWidth())));
« no previous file with comments | « src/gpu/gl/GrGLPath.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698