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

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

Issue 17739003: avoid AntiFrameRect when strokeSize is too small. Workaround for skbug/1368 (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 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 8
9 #include "SkDraw.h" 9 #include "SkDraw.h"
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 SkDEBUGCODE(this->validate();) 846 SkDEBUGCODE(this->validate();)
847 847
848 // nothing to draw 848 // nothing to draw
849 if (fRC->isEmpty()) { 849 if (fRC->isEmpty()) {
850 return; 850 return;
851 } 851 }
852 852
853 SkPoint strokeSize; 853 SkPoint strokeSize;
854 RectType rtype = ComputeRectType(paint, *fMatrix, &strokeSize); 854 RectType rtype = ComputeRectType(paint, *fMatrix, &strokeSize);
855 855
856 // work-around bug in antiframerect when strokesize is < 1
857 if (strokeSize.fX < SK_Scalar1 || strokeSize.fY < SK_Scalar1) {
858 rtype = kPath_RectType;
859 }
860
856 if (kPath_RectType == rtype) { 861 if (kPath_RectType == rtype) {
857 SkPath tmp; 862 SkPath tmp;
858 tmp.addRect(rect); 863 tmp.addRect(rect);
859 tmp.setFillType(SkPath::kWinding_FillType); 864 tmp.setFillType(SkPath::kWinding_FillType);
860 this->drawPath(tmp, paint, NULL, true); 865 this->drawPath(tmp, paint, NULL, true);
861 return; 866 return;
862 } 867 }
863 868
864 const SkMatrix& matrix = *fMatrix; 869 const SkMatrix& matrix = *fMatrix;
865 SkRect devRect; 870 SkRect devRect;
(...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after
2825 mask->fImage = SkMask::AllocImage(size); 2830 mask->fImage = SkMask::AllocImage(size);
2826 memset(mask->fImage, 0, mask->computeImageSize()); 2831 memset(mask->fImage, 0, mask->computeImageSize());
2827 } 2832 }
2828 2833
2829 if (SkMask::kJustComputeBounds_CreateMode != mode) { 2834 if (SkMask::kJustComputeBounds_CreateMode != mode) {
2830 draw_into_mask(*mask, devPath, style); 2835 draw_into_mask(*mask, devPath, style);
2831 } 2836 }
2832 2837
2833 return true; 2838 return true;
2834 } 2839 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698