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

Side by Side Diff: src/effects/SkTestImageFilters.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/effects/SkTableMaskFilter.cpp ('k') | src/effects/SkTileImageFilter.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 2011 Google Inc. 2 * Copyright 2011 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 "SkTestImageFilters.h" 8 #include "SkTestImageFilters.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 if (dstH < 1) { 43 if (dstH < 1) {
44 dstH = 1; 44 dstH = 1;
45 } 45 }
46 46
47 SkBitmap tmp; 47 SkBitmap tmp;
48 48
49 // downsample 49 // downsample
50 { 50 {
51 SkBaseDevice* dev = proxy->createDevice(dstW, dstH); 51 SkBaseDevice* dev = proxy->createDevice(dstW, dstH);
52 if (NULL == dev) { 52 if (nullptr == dev) {
53 return false; 53 return false;
54 } 54 }
55 OwnDeviceCanvas canvas(dev); 55 OwnDeviceCanvas canvas(dev);
56 SkPaint paint; 56 SkPaint paint;
57 57
58 paint.setFilterQuality(kLow_SkFilterQuality); 58 paint.setFilterQuality(kLow_SkFilterQuality);
59 canvas.scale(scale, scale); 59 canvas.scale(scale, scale);
60 canvas.drawBitmap(src, 0, 0, &paint); 60 canvas.drawBitmap(src, 0, 0, &paint);
61 tmp = dev->accessBitmap(false); 61 tmp = dev->accessBitmap(false);
62 } 62 }
63 63
64 // upscale 64 // upscale
65 { 65 {
66 SkBaseDevice* dev = proxy->createDevice(src.width(), src.height()); 66 SkBaseDevice* dev = proxy->createDevice(src.width(), src.height());
67 if (NULL == dev) { 67 if (nullptr == dev) {
68 return false; 68 return false;
69 } 69 }
70 OwnDeviceCanvas canvas(dev); 70 OwnDeviceCanvas canvas(dev);
71 71
72 canvas.drawBitmapRect(tmp, SkRect::MakeIWH(src.width(), src.height()), n ullptr); 72 canvas.drawBitmapRect(tmp, SkRect::MakeIWH(src.width(), src.height()), n ullptr);
73 *result = dev->accessBitmap(false); 73 *result = dev->accessBitmap(false);
74 } 74 }
75 return true; 75 return true;
76 } 76 }
77 77
78 SkFlattenable* SkDownSampleImageFilter::CreateProc(SkReadBuffer& buffer) { 78 SkFlattenable* SkDownSampleImageFilter::CreateProc(SkReadBuffer& buffer) {
79 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 79 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
80 return Create(buffer.readScalar(), common.getInput(0)); 80 return Create(buffer.readScalar(), common.getInput(0));
81 } 81 }
82 82
83 void SkDownSampleImageFilter::flatten(SkWriteBuffer& buffer) const { 83 void SkDownSampleImageFilter::flatten(SkWriteBuffer& buffer) const {
84 this->INHERITED::flatten(buffer); 84 this->INHERITED::flatten(buffer);
85 buffer.writeScalar(fScale); 85 buffer.writeScalar(fScale);
86 } 86 }
87 87
88 #ifndef SK_IGNORE_TO_STRING 88 #ifndef SK_IGNORE_TO_STRING
89 void SkDownSampleImageFilter::toString(SkString* str) const { 89 void SkDownSampleImageFilter::toString(SkString* str) const {
90 str->appendf("SkDownSampleImageFilter: ("); 90 str->appendf("SkDownSampleImageFilter: (");
91 str->append(")"); 91 str->append(")");
92 } 92 }
93 #endif 93 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableMaskFilter.cpp ('k') | src/effects/SkTileImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698