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

Side by Side Diff: src/utils/SkPatchUtils.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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 | « src/utils/SkPatchUtils.h ('k') | src/utils/SkRTConf.cpp » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 Google Inc.
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 "SkPatchUtils.h" 8 #include "SkPatchUtils.h"
9 9
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 void SkPatchUtils::getRightCubic(const SkPoint cubics[12], SkPoint points[4]) { 185 void SkPatchUtils::getRightCubic(const SkPoint cubics[12], SkPoint points[4]) {
186 points[0] = cubics[kRightP0_CubicCtrlPts]; 186 points[0] = cubics[kRightP0_CubicCtrlPts];
187 points[1] = cubics[kRightP1_CubicCtrlPts]; 187 points[1] = cubics[kRightP1_CubicCtrlPts];
188 points[2] = cubics[kRightP2_CubicCtrlPts]; 188 points[2] = cubics[kRightP2_CubicCtrlPts];
189 points[3] = cubics[kRightP3_CubicCtrlPts]; 189 points[3] = cubics[kRightP3_CubicCtrlPts];
190 } 190 }
191 191
192 bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c ubics[12], 192 bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c ubics[12],
193 const SkColor colors[4], const SkPoint texCoords[4], int lodX , int lodY) { 193 const SkColor colors[4], const SkPoint texCoords[4], int lodX , int lodY) {
194 if (lodX < 1 || lodY < 1 || NULL == cubics || NULL == data) { 194 if (lodX < 1 || lodY < 1 || nullptr == cubics || nullptr == data) {
195 return false; 195 return false;
196 } 196 }
197 197
198 // check for overflow in multiplication 198 // check for overflow in multiplication
199 const int64_t lodX64 = (lodX + 1), 199 const int64_t lodX64 = (lodX + 1),
200 lodY64 = (lodY + 1), 200 lodY64 = (lodY + 1),
201 mult64 = lodX64 * lodY64; 201 mult64 = lodX64 * lodY64;
202 if (mult64 > SK_MaxS32) { 202 if (mult64 > SK_MaxS32) {
203 return false; 203 return false;
204 } 204 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 data->fIndices[i + 4] = data->fIndices[i + 2]; 322 data->fIndices[i + 4] = data->fIndices[i + 2];
323 data->fIndices[i + 5] = (x + 1) * stride + y; 323 data->fIndices[i + 5] = (x + 1) * stride + y;
324 } 324 }
325 v = SkScalarClampMax(v + 1.f / lodY, 1); 325 v = SkScalarClampMax(v + 1.f / lodY, 1);
326 } 326 }
327 u = SkScalarClampMax(u + 1.f / lodX, 1); 327 u = SkScalarClampMax(u + 1.f / lodX, 1);
328 } 328 }
329 return true; 329 return true;
330 330
331 } 331 }
OLDNEW
« no previous file with comments | « src/utils/SkPatchUtils.h ('k') | src/utils/SkRTConf.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698