aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2015-05-21 22:45:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-21 22:45:56 -0700
commit806236e7974e8d05feecb8264eb361759f9db536 (patch)
tree04c925087a93c641685cdec188e5391b523377be /src/gpu
parent4e13a23d8f720e17660f26657b45b89fe4339004 (diff)
Mark SkPaths created by GrContext fallback draw logic as volatile
GrContext draw functions (drawRect, drawRRect,...) fall back to GrContext::drawPath for complex cases. Mark the argument SkPath as volatile, since it is. Progressions for nvprmsaa: tabl_androidpolice.skp_1 11.6ms -> 10.3ms 0.89x desk_twitter.skp_1 9.21ms -> 8.08ms 0.88x tabl_sahadan.skp_1 8.97ms -> 7.65ms 0.85x desk_wikipedia.skp_1 5.63ms -> 4.5ms 0.8x desk_booking.skp_1 11.5ms -> 8.87ms 0.77x desk_ebay.skp_1 7ms -> 5.37ms 0.77x Makes rrects and rects go to "simple path" path cache (cached by contents). No change for msaa, gpu. BUG=skia: Review URL: https://codereview.chromium.org/1150993002
Diffstat (limited to 'src/gpu')
-rwxr-xr-xsrc/gpu/GrContext.cpp7
-rw-r--r--src/gpu/GrPath.cpp1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 18f26efc65..342fb2175e 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -580,6 +580,7 @@ void GrContext::drawRect(GrRenderTarget* rt,
RETURN_IF_ABANDONED
if (strokeInfo && strokeInfo->isDashed()) {
SkPath path;
+ path.setIsVolatile(true);
path.addRect(rect);
this->drawPath(rt, clip, paint, viewMatrix, path, *strokeInfo);
return;
@@ -1037,6 +1038,7 @@ void GrContext::drawRRect(GrRenderTarget*rt,
if (strokeInfo.isDashed()) {
SkPath path;
+ path.setIsVolatile(true);
path.addRRect(rrect);
this->drawPath(rt, clip, paint, viewMatrix, path, strokeInfo);
return;
@@ -1060,6 +1062,7 @@ void GrContext::drawRRect(GrRenderTarget*rt,
rrect,
strokeInfo)) {
SkPath path;
+ path.setIsVolatile(true);
path.addRRect(rrect);
this->internalDrawPath(target, &pipelineBuilder, viewMatrix, color, paint.isAntiAlias(),
path, strokeInfo);
@@ -1094,10 +1097,10 @@ void GrContext::drawDRRect(GrRenderTarget* rt,
outer,
inner)) {
SkPath path;
+ path.setIsVolatile(true);
path.addRRect(inner);
path.addRRect(outer);
path.setFillType(SkPath::kEvenOdd_FillType);
-
GrStrokeInfo fillRec(SkStrokeRec::kFill_InitStyle);
this->internalDrawPath(target, &pipelineBuilder, viewMatrix, color, paint.isAntiAlias(),
path, fillRec);
@@ -1119,6 +1122,7 @@ void GrContext::drawOval(GrRenderTarget* rt,
if (strokeInfo.isDashed()) {
SkPath path;
+ path.setIsVolatile(true);
path.addOval(oval);
this->drawPath(rt, clip, paint, viewMatrix, path, strokeInfo);
return;
@@ -1142,6 +1146,7 @@ void GrContext::drawOval(GrRenderTarget* rt,
oval,
strokeInfo)) {
SkPath path;
+ path.setIsVolatile(true);
path.addOval(oval);
this->internalDrawPath(target, &pipelineBuilder, viewMatrix, color, paint.isAntiAlias(),
path, strokeInfo);
diff --git a/src/gpu/GrPath.cpp b/src/gpu/GrPath.cpp
index 5b75683628..421edd32ea 100644
--- a/src/gpu/GrPath.cpp
+++ b/src/gpu/GrPath.cpp
@@ -62,7 +62,6 @@ inline static bool compute_key_for_simple_path(const SkPath& path, const GrStrok
if (!path.isVolatile()) {
return false;
}
-
// The check below should take care of negative values casted positive.
const int verbCnt = path.countVerbs();
if (verbCnt > kSimpleVolatilePathVerbLimit) {