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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1470103002: Clarify when oval & rrects get devolved to paths in SkGpuDevice/GrDrawContext boundary (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/GrDrawContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 9b6a5304d2642374f9644781cefe44d5bafe87ba..b8630e555530cb8273c02527a1538fbdc0a42e4f 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -567,19 +567,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
}
- bool usePath = false;
-
- if (paint.getMaskFilter()) {
- usePath = true;
- } else {
- const SkPathEffect* pe = paint.getPathEffect();
- if (pe && !strokeInfo.isDashed()) {
- usePath = true;
- }
- }
-
-
- if (usePath) {
+ if (paint.getMaskFilter() || paint.getPathEffect()) {
reed1 2015/11/24 14:42:29 I wonder if a brief comment would help here. Is th
SkPath path;
path.setIsVolatile(true);
path.addRRect(rect);
@@ -587,6 +575,8 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
return;
}
+ SkASSERT(!strokeInfo.isDashed());
+
fDrawContext->drawRRect(fClip, grPaint, *draw.fMatrix, rect, strokeInfo);
}
@@ -621,33 +611,24 @@ void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
/////////////////////////////////////////////////////////////////////////////
-void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval,
- const SkPaint& paint) {
+void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval, const SkPaint& paint) {
GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawOval", fContext);
CHECK_FOR_ANNOTATION(paint);
CHECK_SHOULD_DRAW(draw);
- GrStrokeInfo strokeInfo(paint);
-
- bool usePath = false;
- // some basic reasons we might need to call drawPath...
- if (paint.getMaskFilter()) {
- // The RRect path can handle special case blurring
- SkRRect rr = SkRRect::MakeOval(oval);
- return this->drawRRect(draw, rr, paint);
- } else {
- const SkPathEffect* pe = paint.getPathEffect();
- if (pe && !strokeInfo.isDashed()) {
- usePath = true;
- }
- }
-
- if (usePath) {
+ // Presumably the path effect warps this to something other than an oval
+ if (paint.getPathEffect()) {
SkPath path;
path.setIsVolatile(true);
path.addOval(oval);
this->drawPath(draw, path, paint, nullptr, true);
return;
+ }
+
+ if (paint.getMaskFilter()) {
+ // The RRect path can handle special case blurring
+ SkRRect rr = SkRRect::MakeOval(oval);
+ return this->drawRRect(draw, rr, paint);
}
GrPaint grPaint;
@@ -655,6 +636,9 @@ void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval,
return;
}
+ GrStrokeInfo strokeInfo(paint);
+ SkASSERT(!strokeInfo.isDashed());
+
fDrawContext->drawOval(fClip, grPaint, *draw.fMatrix, oval, strokeInfo);
}
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698