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

Side by Side Diff: src/image/SkSurface_Raster.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/image/SkSurface_Gpu.cpp ('k') | src/images/SkDecodingImageGenerator.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 2012 Google Inc. 2 * Copyright 2012 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 "SkSurface_Base.h" 8 #include "SkSurface_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 fBitmap.setInfo(info, info.minRowBytes()); 99 fBitmap.setInfo(info, info.minRowBytes());
100 fBitmap.setPixelRef(pr); 100 fBitmap.setPixelRef(pr);
101 fWeOwnThePixels = true; 101 fWeOwnThePixels = true;
102 102
103 if (!info.isOpaque()) { 103 if (!info.isOpaque()) {
104 fBitmap.eraseColor(SK_ColorTRANSPARENT); 104 fBitmap.eraseColor(SK_ColorTRANSPARENT);
105 } 105 }
106 } 106 }
107 107
108 SkCanvas* SkSurface_Raster::onNewCanvas() { 108 SkCanvas* SkSurface_Raster::onNewCanvas() { return new SkCanvas(fBitmap, this->p rops()); }
109 return SkNEW_ARGS(SkCanvas, (fBitmap, this->props()));
110 }
111 109
112 SkSurface* SkSurface_Raster::onNewSurface(const SkImageInfo& info) { 110 SkSurface* SkSurface_Raster::onNewSurface(const SkImageInfo& info) {
113 return SkSurface::NewRaster(info, &this->props()); 111 return SkSurface::NewRaster(info, &this->props());
114 } 112 }
115 113
116 void SkSurface_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, 114 void SkSurface_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
117 const SkPaint* paint) { 115 const SkPaint* paint) {
118 canvas->drawBitmap(fBitmap, x, y, paint); 116 canvas->drawBitmap(fBitmap, x, y, paint);
119 } 117 }
120 118
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if (NULL == releaseProc) { 165 if (NULL == releaseProc) {
168 context = NULL; 166 context = NULL;
169 } 167 }
170 if (!SkSurface_Raster::Valid(info, rb)) { 168 if (!SkSurface_Raster::Valid(info, rb)) {
171 return NULL; 169 return NULL;
172 } 170 }
173 if (NULL == pixels) { 171 if (NULL == pixels) {
174 return NULL; 172 return NULL;
175 } 173 }
176 174
177 return SkNEW_ARGS(SkSurface_Raster, (info, pixels, rb, releaseProc, context, props)); 175 return new SkSurface_Raster(info, pixels, rb, releaseProc, context, props);
178 } 176 }
179 177
180 SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, siz e_t rowBytes, 178 SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, siz e_t rowBytes,
181 const SkSurfaceProps* props) { 179 const SkSurfaceProps* props) {
182 return NewRasterDirectReleaseProc(info, pixels, rowBytes, NULL, NULL, props) ; 180 return NewRasterDirectReleaseProc(info, pixels, rowBytes, NULL, NULL, props) ;
183 } 181 }
184 182
185 SkSurface* SkSurface::NewRaster(const SkImageInfo& info, const SkSurfaceProps* p rops) { 183 SkSurface* SkSurface::NewRaster(const SkImageInfo& info, const SkSurfaceProps* p rops) {
186 if (!SkSurface_Raster::Valid(info)) { 184 if (!SkSurface_Raster::Valid(info)) {
187 return NULL; 185 return NULL;
188 } 186 }
189 187
190 SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, NULL)); 188 SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, NULL));
191 if (NULL == pr.get()) { 189 if (NULL == pr.get()) {
192 return NULL; 190 return NULL;
193 } 191 }
194 return SkNEW_ARGS(SkSurface_Raster, (pr, props)); 192 return new SkSurface_Raster(pr, props);
195 } 193 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698