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

Side by Side Diff: src/utils/SkCamera.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/SkBoundaryPatch.cpp ('k') | src/utils/SkCanvasStateUtils.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 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 "SkCamera.h" 8 #include "SkCamera.h"
9 9
10 static SkScalar SkScalarDotDiv(int count, const SkScalar a[], int step_a, 10 static SkScalar SkScalarDotDiv(int count, const SkScalar a[], int step_a,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 this->reset(); 67 this->reset();
68 } 68 }
69 69
70 void SkPatch3D::reset() { 70 void SkPatch3D::reset() {
71 fOrigin.set(0, 0, 0); 71 fOrigin.set(0, 0, 0);
72 fU.set(SK_Scalar1, 0, 0); 72 fU.set(SK_Scalar1, 0, 0);
73 fV.set(0, -SK_Scalar1, 0); 73 fV.set(0, -SK_Scalar1, 0);
74 } 74 }
75 75
76 void SkPatch3D::transform(const SkMatrix3D& m, SkPatch3D* dst) const { 76 void SkPatch3D::transform(const SkMatrix3D& m, SkPatch3D* dst) const {
77 if (dst == NULL) { 77 if (dst == nullptr) {
78 dst = (SkPatch3D*)this; 78 dst = (SkPatch3D*)this;
79 } 79 }
80 m.mapVector(fU, &dst->fU); 80 m.mapVector(fU, &dst->fU);
81 m.mapVector(fV, &dst->fV); 81 m.mapVector(fV, &dst->fV);
82 m.mapPoint(fOrigin, &dst->fOrigin); 82 m.mapPoint(fOrigin, &dst->fOrigin);
83 } 83 }
84 84
85 SkScalar SkPatch3D::dotWith(SkScalar dx, SkScalar dy, SkScalar dz) const { 85 SkScalar SkPatch3D::dotWith(SkScalar dx, SkScalar dy, SkScalar dz) const {
86 SkScalar cx = SkScalarMul(fU.fY, fV.fZ) - SkScalarMul(fU.fZ, fV.fY); 86 SkScalar cx = SkScalarMul(fU.fY, fV.fZ) - SkScalarMul(fU.fZ, fV.fY);
87 SkScalar cy = SkScalarMul(fU.fZ, fV.fX) - SkScalarMul(fU.fX, fV.fY); 87 SkScalar cy = SkScalarMul(fU.fZ, fV.fX) - SkScalarMul(fU.fX, fV.fY);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 fRec->fMatrix.preRotateZ(deg); 349 fRec->fMatrix.preRotateZ(deg);
350 } 350 }
351 351
352 SkScalar Sk3DView::dotWithNormal(SkScalar x, SkScalar y, SkScalar z) const { 352 SkScalar Sk3DView::dotWithNormal(SkScalar x, SkScalar y, SkScalar z) const {
353 SkPatch3D patch; 353 SkPatch3D patch;
354 patch.transform(fRec->fMatrix); 354 patch.transform(fRec->fMatrix);
355 return patch.dotWith(x, y, z); 355 return patch.dotWith(x, y, z);
356 } 356 }
357 357
358 void Sk3DView::getMatrix(SkMatrix* matrix) const { 358 void Sk3DView::getMatrix(SkMatrix* matrix) const {
359 if (matrix != NULL) { 359 if (matrix != nullptr) {
360 SkPatch3D patch; 360 SkPatch3D patch;
361 patch.transform(fRec->fMatrix); 361 patch.transform(fRec->fMatrix);
362 fCamera.patchToMatrix(patch, matrix); 362 fCamera.patchToMatrix(patch, matrix);
363 } 363 }
364 } 364 }
365 365
366 #include "SkCanvas.h" 366 #include "SkCanvas.h"
367 367
368 void Sk3DView::applyToCanvas(SkCanvas* canvas) const { 368 void Sk3DView::applyToCanvas(SkCanvas* canvas) const {
369 SkMatrix matrix; 369 SkMatrix matrix;
370 370
371 this->getMatrix(&matrix); 371 this->getMatrix(&matrix);
372 canvas->concat(matrix); 372 canvas->concat(matrix);
373 } 373 }
OLDNEW
« no previous file with comments | « src/utils/SkBoundaryPatch.cpp ('k') | src/utils/SkCanvasStateUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698