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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 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/svg/skp2svg.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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 Sk3DView::Sk3DView() { 285 Sk3DView::Sk3DView() {
286 fInitialRec.fMatrix.reset(); 286 fInitialRec.fMatrix.reset();
287 fRec = &fInitialRec; 287 fRec = &fInitialRec;
288 } 288 }
289 289
290 Sk3DView::~Sk3DView() { 290 Sk3DView::~Sk3DView() {
291 Rec* rec = fRec; 291 Rec* rec = fRec;
292 while (rec != &fInitialRec) { 292 while (rec != &fInitialRec) {
293 Rec* next = rec->fNext; 293 Rec* next = rec->fNext;
294 SkDELETE(rec); 294 delete rec;
295 rec = next; 295 rec = next;
296 } 296 }
297 } 297 }
298 298
299 void Sk3DView::save() { 299 void Sk3DView::save() {
300 Rec* rec = SkNEW(Rec); 300 Rec* rec = new Rec;
301 rec->fNext = fRec; 301 rec->fNext = fRec;
302 rec->fMatrix = fRec->fMatrix; 302 rec->fMatrix = fRec->fMatrix;
303 fRec = rec; 303 fRec = rec;
304 } 304 }
305 305
306 void Sk3DView::restore() { 306 void Sk3DView::restore() {
307 SkASSERT(fRec != &fInitialRec); 307 SkASSERT(fRec != &fInitialRec);
308 Rec* next = fRec->fNext; 308 Rec* next = fRec->fNext;
309 SkDELETE(fRec); 309 delete fRec;
310 fRec = next; 310 fRec = next;
311 } 311 }
312 312
313 #ifdef SK_BUILD_FOR_ANDROID 313 #ifdef SK_BUILD_FOR_ANDROID
314 void Sk3DView::setCameraLocation(SkScalar x, SkScalar y, SkScalar z) { 314 void Sk3DView::setCameraLocation(SkScalar x, SkScalar y, SkScalar z) {
315 // the camera location is passed in inches, set in pt 315 // the camera location is passed in inches, set in pt
316 SkScalar lz = z * 72.0f; 316 SkScalar lz = z * 72.0f;
317 fCamera.fLocation.set(x * 72.0f, y * 72.0f, lz); 317 fCamera.fLocation.set(x * 72.0f, y * 72.0f, lz);
318 fCamera.fObserver.set(0, 0, lz); 318 fCamera.fObserver.set(0, 0, lz);
319 fCamera.update(); 319 fCamera.update();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/svg/skp2svg.cpp ('k') | src/utils/SkCanvasStateUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698