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

Side by Side Diff: src/core/SkPictureImageGenerator.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/core/SkPictureFlat.cpp ('k') | src/core/SkPictureRecorder.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 2015 Google Inc. 2 * Copyright 2015 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 "SkImageGenerator.h" 8 #include "SkImageGenerator.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkMatrix.h" 10 #include "SkMatrix.h"
(...skipping 23 matching lines...) Expand all
34 34
35 typedef SkImageGenerator INHERITED; 35 typedef SkImageGenerator INHERITED;
36 }; 36 };
37 37
38 SkImageGenerator* SkPictureImageGenerator::Create(const SkISize& size, const SkP icture* picture, 38 SkImageGenerator* SkPictureImageGenerator::Create(const SkISize& size, const SkP icture* picture,
39 const SkMatrix* matrix, const SkPaint* paint) { 39 const SkMatrix* matrix, const SkPaint* paint) {
40 if (!picture || size.isEmpty()) { 40 if (!picture || size.isEmpty()) {
41 return nullptr; 41 return nullptr;
42 } 42 }
43 43
44 return SkNEW_ARGS(SkPictureImageGenerator, (size, picture, matrix, paint)); 44 return new SkPictureImageGenerator(size, picture, matrix, paint);
45 } 45 }
46 46
47 SkPictureImageGenerator::SkPictureImageGenerator(const SkISize& size, const SkPi cture* picture, 47 SkPictureImageGenerator::SkPictureImageGenerator(const SkISize& size, const SkPi cture* picture,
48 const SkMatrix* matrix, const S kPaint* paint) 48 const SkMatrix* matrix, const S kPaint* paint)
49 : INHERITED(SkImageInfo::MakeN32Premul(size)) 49 : INHERITED(SkImageInfo::MakeN32Premul(size))
50 , fPicture(SkRef(picture)) { 50 , fPicture(SkRef(picture)) {
51 51
52 if (matrix) { 52 if (matrix) {
53 fMatrix = *matrix; 53 fMatrix = *matrix;
54 } else { 54 } else {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 surface->getCanvas()->clear(0); // does NewRenderTarget promise to do this f or us? 110 surface->getCanvas()->clear(0); // does NewRenderTarget promise to do this f or us?
111 surface->getCanvas()->drawPicture(fPicture, &matrix, fPaint.getMaybeNull()); 111 surface->getCanvas()->drawPicture(fPicture, &matrix, fPaint.getMaybeNull());
112 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); 112 SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
113 if (!image.get()) { 113 if (!image.get()) {
114 return nullptr; 114 return nullptr;
115 } 115 }
116 return SkSafeRef(image->getTexture()); 116 return SkSafeRef(image->getTexture());
117 } 117 }
118 #endif 118 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.cpp ('k') | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698