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

Side by Side Diff: samplecode/SampleChart.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 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 | « samplecode/SampleApp.cpp ('k') | samplecode/SampleFilterFuzz.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 2013 Google Inc. 2 * Copyright 2013 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 fill->lineTo(x, topData[i + leftShift]); 53 fill->lineTo(x, topData[i + leftShift]);
54 x += xDelta; 54 x += xDelta;
55 } 55 }
56 56
57 for (int i = 0; i < leftShift; ++i) { 57 for (int i = 0; i < leftShift; ++i) {
58 plot->lineTo(x, topData[i]); 58 plot->lineTo(x, topData[i]);
59 fill->lineTo(x, topData[i]); 59 fill->lineTo(x, topData[i]);
60 x += xDelta; 60 x += xDelta;
61 } 61 }
62 62
63 if (NULL != bottomData) { 63 if (bottomData) {
64 SkASSERT(bottomData->count() == topData.count()); 64 SkASSERT(bottomData->count() == topData.count());
65 // iterate backwards over the previous graph's data to generate the bott om of the filled 65 // iterate backwards over the previous graph's data to generate the bott om of the filled
66 // area (and account for leftShift). 66 // area (and account for leftShift).
67 for (int i = 0; i < leftShift; ++i) { 67 for (int i = 0; i < leftShift; ++i) {
68 x -= xDelta; 68 x -= xDelta;
69 fill->lineTo(x, (*bottomData)[leftShift - 1 - i]); 69 fill->lineTo(x, (*bottomData)[leftShift - 1 - i]);
70 } 70 }
71 for (int i = 0; i < shiftToEndCount; ++i) { 71 for (int i = 0; i < shiftToEndCount; ++i) {
72 x -= xDelta; 72 x -= xDelta;
73 fill->lineTo(x, (*bottomData)[bottomData->count() - 1 - i]); 73 fill->lineTo(x, (*bottomData)[bottomData->count() - 1 - i]);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 int fShift; 175 int fShift;
176 SkISize fSize; 176 SkISize fSize;
177 SkTDArray<SkScalar> fData[kNumGraphs]; 177 SkTDArray<SkScalar> fData[kNumGraphs];
178 typedef SampleView INHERITED; 178 typedef SampleView INHERITED;
179 }; 179 };
180 180
181 ////////////////////////////////////////////////////////////////////////////// 181 //////////////////////////////////////////////////////////////////////////////
182 182
183 static SkView* MyFactory() { return new ChartView; } 183 static SkView* MyFactory() { return new ChartView; }
184 static SkViewRegister reg(MyFactory); 184 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698