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

Unified Diff: src/gpu/effects/GrBezierEffect.h

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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/batches/GrTessellatingPathRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBezierEffect.h
diff --git a/src/gpu/effects/GrBezierEffect.h b/src/gpu/effects/GrBezierEffect.h
index ddb249b587ac86dd297a22b2e2d8d58f4fc6f848..50dca99242d2d3da7a45d69b92e29203b61d5df7 100644
--- a/src/gpu/effects/GrBezierEffect.h
+++ b/src/gpu/effects/GrBezierEffect.h
@@ -58,30 +58,33 @@ class GrGLConicEffect;
class GrConicEffect : public GrGeometryProcessor {
public:
- static GrGeometryProcessor* Create(GrColor color,
- const SkMatrix& viewMatrix,
- const GrPrimitiveEdgeType edgeType,
- const GrCaps& caps,
- const SkMatrix& localMatrix,
- bool usesLocalCoords,
- uint8_t coverage = 0xff) {
+ static sk_sp<GrGeometryProcessor> Make(GrColor color,
+ const SkMatrix& viewMatrix,
+ const GrPrimitiveEdgeType edgeType,
+ const GrCaps& caps,
+ const SkMatrix& localMatrix,
+ bool usesLocalCoords,
+ uint8_t coverage = 0xff) {
switch (edgeType) {
case kFillAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
return nullptr;
}
- return new GrConicEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
- localMatrix, usesLocalCoords);
+ return sk_sp<GrGeometryProcessor>(
+ new GrConicEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
+ localMatrix, usesLocalCoords));
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
return nullptr;
}
- return new GrConicEffect(color, viewMatrix, coverage,
- kHairlineAA_GrProcessorEdgeType, localMatrix,
- usesLocalCoords);
+ return sk_sp<GrGeometryProcessor>(
+ new GrConicEffect(color, viewMatrix, coverage,
+ kHairlineAA_GrProcessorEdgeType, localMatrix,
+ usesLocalCoords));
case kFillBW_GrProcessorEdgeType:
- return new GrConicEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
- localMatrix, usesLocalCoords);
+ return sk_sp<GrGeometryProcessor>(
+ new GrConicEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
+ localMatrix, usesLocalCoords));
default:
return nullptr;
}
@@ -138,30 +141,33 @@ class GrGLQuadEffect;
class GrQuadEffect : public GrGeometryProcessor {
public:
- static GrGeometryProcessor* Create(GrColor color,
- const SkMatrix& viewMatrix,
- const GrPrimitiveEdgeType edgeType,
- const GrCaps& caps,
- const SkMatrix& localMatrix,
- bool usesLocalCoords,
- uint8_t coverage = 0xff) {
+ static sk_sp<GrGeometryProcessor> Make(GrColor color,
+ const SkMatrix& viewMatrix,
+ const GrPrimitiveEdgeType edgeType,
+ const GrCaps& caps,
+ const SkMatrix& localMatrix,
+ bool usesLocalCoords,
+ uint8_t coverage = 0xff) {
switch (edgeType) {
case kFillAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
return nullptr;
}
- return new GrQuadEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
- localMatrix, usesLocalCoords);
+ return sk_sp<GrGeometryProcessor>(
+ new GrQuadEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
+ localMatrix, usesLocalCoords));
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
return nullptr;
}
- return new GrQuadEffect(color, viewMatrix, coverage,
- kHairlineAA_GrProcessorEdgeType, localMatrix,
- usesLocalCoords);
+ return sk_sp<GrGeometryProcessor>(
+ new GrQuadEffect(color, viewMatrix, coverage,
+ kHairlineAA_GrProcessorEdgeType, localMatrix,
+ usesLocalCoords));
case kFillBW_GrProcessorEdgeType:
- return new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
- localMatrix, usesLocalCoords);
+ return sk_sp<GrGeometryProcessor>(
+ new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
+ localMatrix, usesLocalCoords));
default:
return nullptr;
}
@@ -220,23 +226,26 @@ class GrGLCubicEffect;
class GrCubicEffect : public GrGeometryProcessor {
public:
- static GrGeometryProcessor* Create(GrColor color,
- const SkMatrix& viewMatrix,
- const GrPrimitiveEdgeType edgeType,
- const GrCaps& caps) {
+ static sk_sp<GrGeometryProcessor> Make(GrColor color,
+ const SkMatrix& viewMatrix,
+ const GrPrimitiveEdgeType edgeType,
+ const GrCaps& caps) {
switch (edgeType) {
case kFillAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
return nullptr;
}
- return new GrCubicEffect(color, viewMatrix, kFillAA_GrProcessorEdgeType);
+ return sk_sp<GrGeometryProcessor>(
+ new GrCubicEffect(color, viewMatrix, kFillAA_GrProcessorEdgeType));
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
return nullptr;
}
- return new GrCubicEffect(color, viewMatrix, kHairlineAA_GrProcessorEdgeType);
+ return sk_sp<GrGeometryProcessor>(
+ new GrCubicEffect(color, viewMatrix, kHairlineAA_GrProcessorEdgeType));
case kFillBW_GrProcessorEdgeType:
- return new GrCubicEffect(color, viewMatrix, kFillBW_GrProcessorEdgeType);
+ return sk_sp<GrGeometryProcessor>(
+ new GrCubicEffect(color, viewMatrix, kFillBW_GrProcessorEdgeType));
default:
return nullptr;
}
« no previous file with comments | « src/gpu/batches/GrTessellatingPathRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698