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/SkGpuDevice.cpp

Issue 220233011: Implement drawDRRect for GPU (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 8 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/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | 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 6f6d99140bc80881d01903702e0cb556911f9d08..d66006e91c4aef9dfd99a8b9f44c6f245a905c9e 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -656,17 +656,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
}
- bool usePath = !rect.isSimple();
- // another two reasons we might need to call drawPath...
if (paint.getMaskFilter() || paint.getPathEffect()) {
- usePath = true;
- }
- // until we can rotate rrects...
- if (!usePath && !fContext->getMatrix().rectStaysRect()) {
- usePath = true;
- }
-
- if (usePath) {
SkPath path;
path.addRRect(rect);
this->drawPath(draw, path, paint, NULL, true);
@@ -676,6 +666,34 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
fContext->drawRRect(grPaint, rect, stroke);
}
+void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
+ const SkRRect& inner, const SkPaint& paint) {
+ SkStrokeRec stroke(paint);
+ if (stroke.isFillStyle()) {
+
+ CHECK_FOR_ANNOTATION(paint);
+ CHECK_SHOULD_DRAW(draw, false);
+
+ GrPaint grPaint;
+ if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) {
+ return;
+ }
+
+ if (NULL == paint.getMaskFilter() && NULL == paint.getPathEffect()) {
+ fContext->drawDRRect(grPaint, outer, inner);
+ return;
+ }
+ }
+
+ SkPath path;
+ path.addRRect(outer);
+ path.addRRect(inner);
+ path.setFillType(SkPath::kEvenOdd_FillType);
+
+ this->drawPath(draw, path, paint, NULL, true);
+}
+
+
/////////////////////////////////////////////////////////////////////////////
void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval,
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698