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

Side by Side Diff: src/effects/SkTableMaskFilter.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/SkTableColorFilter.cpp ('k') | src/effects/SkTestImageFilters.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkTableMaskFilter.h" 10 #include "SkTableMaskFilter.h"
(...skipping 15 matching lines...) Expand all
26 26
27 bool SkTableMaskFilter::filterMask(SkMask* dst, const SkMask& src, 27 bool SkTableMaskFilter::filterMask(SkMask* dst, const SkMask& src,
28 const SkMatrix&, SkIPoint* margin) const { 28 const SkMatrix&, SkIPoint* margin) const {
29 if (src.fFormat != SkMask::kA8_Format) { 29 if (src.fFormat != SkMask::kA8_Format) {
30 return false; 30 return false;
31 } 31 }
32 32
33 dst->fBounds = src.fBounds; 33 dst->fBounds = src.fBounds;
34 dst->fRowBytes = SkAlign4(dst->fBounds.width()); 34 dst->fRowBytes = SkAlign4(dst->fBounds.width());
35 dst->fFormat = SkMask::kA8_Format; 35 dst->fFormat = SkMask::kA8_Format;
36 dst->fImage = NULL; 36 dst->fImage = nullptr;
37 37
38 if (src.fImage) { 38 if (src.fImage) {
39 dst->fImage = SkMask::AllocImage(dst->computeImageSize()); 39 dst->fImage = SkMask::AllocImage(dst->computeImageSize());
40 40
41 const uint8_t* srcP = src.fImage; 41 const uint8_t* srcP = src.fImage;
42 uint8_t* dstP = dst->fImage; 42 uint8_t* dstP = dst->fImage;
43 const uint8_t* table = fTable; 43 const uint8_t* table = fTable;
44 int dstWidth = dst->fBounds.width(); 44 int dstWidth = dst->fBounds.width();
45 int extraZeros = dst->fRowBytes - dstWidth; 45 int extraZeros = dst->fRowBytes - dstWidth;
46 46
(...skipping 23 matching lines...) Expand all
70 return SkMask::kA8_Format; 70 return SkMask::kA8_Format;
71 } 71 }
72 72
73 void SkTableMaskFilter::flatten(SkWriteBuffer& wb) const { 73 void SkTableMaskFilter::flatten(SkWriteBuffer& wb) const {
74 wb.writeByteArray(fTable, 256); 74 wb.writeByteArray(fTable, 256);
75 } 75 }
76 76
77 SkFlattenable* SkTableMaskFilter::CreateProc(SkReadBuffer& buffer) { 77 SkFlattenable* SkTableMaskFilter::CreateProc(SkReadBuffer& buffer) {
78 uint8_t table[256]; 78 uint8_t table[256];
79 if (!buffer.readByteArray(table, 256)) { 79 if (!buffer.readByteArray(table, 256)) {
80 return NULL; 80 return nullptr;
81 } 81 }
82 return Create(table); 82 return Create(table);
83 } 83 }
84 84
85 /////////////////////////////////////////////////////////////////////////////// 85 ///////////////////////////////////////////////////////////////////////////////
86 86
87 void SkTableMaskFilter::MakeGammaTable(uint8_t table[256], SkScalar gamma) { 87 void SkTableMaskFilter::MakeGammaTable(uint8_t table[256], SkScalar gamma) {
88 const float dx = 1 / 255.0f; 88 const float dx = 1 / 255.0f;
89 const float g = SkScalarToFloat(gamma); 89 const float g = SkScalarToFloat(gamma);
90 90
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 str->append("table: "); 137 str->append("table: ");
138 for (int i = 0; i < 255; ++i) { 138 for (int i = 0; i < 255; ++i) {
139 str->appendf("%d, ", fTable[i]); 139 str->appendf("%d, ", fTable[i]);
140 } 140 }
141 str->appendf("%d", fTable[255]); 141 str->appendf("%d", fTable[255]);
142 142
143 str->append(")"); 143 str->append(")");
144 } 144 }
145 #endif 145 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698