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

Side by Side Diff: src/core/SkStroke.cpp

Issue 16950021: add rect-output parameter to isRect, allowing us to return the correct bounds even if a rectagular … (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkStrokerPriv.h" 8 #include "SkStrokerPriv.h"
9 #include "SkGeometry.h" 9 #include "SkGeometry.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 SkScalar radius = SkScalarHalf(fWidth); 542 SkScalar radius = SkScalarHalf(fWidth);
543 543
544 AutoTmpPath tmp(src, &dst); 544 AutoTmpPath tmp(src, &dst);
545 545
546 if (radius <= 0) { 546 if (radius <= 0) {
547 return; 547 return;
548 } 548 }
549 549
550 // If src is really a rect, call our specialty strokeRect() method 550 // If src is really a rect, call our specialty strokeRect() method
551 { 551 {
552 SkRect rect;
552 bool isClosed; 553 bool isClosed;
553 SkPath::Direction dir; 554 SkPath::Direction dir;
554 if (src.isRect(&isClosed, &dir) && isClosed) { 555 if (src.isRect(&rect, &isClosed, &dir) && isClosed) {
555 this->strokeRect(src.getBounds(), dst, dir); 556 this->strokeRect(rect, dst, dir);
556 // our answer should preserve the inverseness of the src 557 // our answer should preserve the inverseness of the src
557 if (src.isInverseFillType()) { 558 if (src.isInverseFillType()) {
558 SkASSERT(!dst->isInverseFillType()); 559 SkASSERT(!dst->isInverseFillType());
559 dst->toggleInverseFillType(); 560 dst->toggleInverseFillType();
560 } 561 }
561 return; 562 return;
562 } 563 }
563 } 564 }
564 565
565 SkAutoConicToQuads converter; 566 SkAutoConicToQuads converter;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 default: 717 default:
717 break; 718 break;
718 } 719 }
719 720
720 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { 721 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) {
721 r = rect; 722 r = rect;
722 r.inset(radius, radius); 723 r.inset(radius, radius);
723 dst->addRect(r, reverse_direction(dir)); 724 dst->addRect(r, reverse_direction(dir));
724 } 725 }
725 } 726 }
OLDNEW
« include/core/SkPath.h ('K') | « src/core/SkPath.cpp ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698