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

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

Issue 2030713002: Fix uninit warning on valgrind bot in SkPathPriv:IsSimpleClosedRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« 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 #include <cmath> 8 #include <cmath>
9 #include "SkBuffer.h" 9 #include "SkBuffer.h"
10 #include "SkCubicClipper.h" 10 #include "SkCubicClipper.h"
(...skipping 3277 matching lines...) Expand 10 before | Expand all | Expand 10 after
3288 } 3288 }
3289 if (rectPtCnt < 5) { 3289 if (rectPtCnt < 5) {
3290 return false; 3290 return false;
3291 } 3291 }
3292 if (rectPts[0] != rectPts[4]) { 3292 if (rectPts[0] != rectPts[4]) {
3293 return false; 3293 return false;
3294 } 3294 }
3295 int verticalCnt = 0; 3295 int verticalCnt = 0;
3296 int horizontalCnt = 0; 3296 int horizontalCnt = 0;
3297 // dirs are 0 - right, 1 - down, 2 - left, 3 - up. 3297 // dirs are 0 - right, 1 - down, 2 - left, 3 - up.
3298 int firstDir; 3298 int firstDir = 0;
3299 int secondDir; 3299 int secondDir = 0;
3300 SkRect tempRect; 3300 SkRect tempRect;
3301 for (int i = 0; i < 4; ++i) { 3301 for (int i = 0; i < 4; ++i) {
3302 int sameCnt = 0; 3302 int sameCnt = 0;
3303 if (rectPts[i].fX == rectPts[i + 1].fX) { 3303 if (rectPts[i].fX == rectPts[i + 1].fX) {
3304 verticalCnt += 1; 3304 verticalCnt += 1;
3305 sameCnt = 1; 3305 sameCnt = 1;
3306 if (0 == i) { 3306 if (0 == i) {
3307 if (rectPts[1].fY > rectPts[0].fY) { 3307 if (rectPts[1].fY > rectPts[0].fY) {
3308 firstDir = 1; 3308 firstDir = 1;
3309 tempRect.fTop = rectPts[0].fY; 3309 tempRect.fTop = rectPts[0].fY;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
3358 return false; 3358 return false;
3359 } 3359 }
3360 // low bit indicates a vertical dir 3360 // low bit indicates a vertical dir
3361 SkASSERT((firstDir ^ secondDir) & 0b1); 3361 SkASSERT((firstDir ^ secondDir) & 0b1);
3362 if (((firstDir + 1) & 0b11) == secondDir) { 3362 if (((firstDir + 1) & 0b11) == secondDir) {
3363 *direction = SkPath::kCW_Direction; 3363 *direction = SkPath::kCW_Direction;
3364 *start = firstDir; 3364 *start = firstDir;
3365 } else { 3365 } else {
3366 SkASSERT(((secondDir + 1) & 0b11) == firstDir); 3366 SkASSERT(((secondDir + 1) & 0b11) == firstDir);
3367 *direction = SkPath::kCCW_Direction; 3367 *direction = SkPath::kCCW_Direction;
3368 *start = secondDir; 3368 *start = secondDir;
3369 } 3369 }
3370 *rect = tempRect; 3370 *rect = tempRect;
3371 return true; 3371 return true;
3372 } 3372 }
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