93 {
94 bool sizeChanged = false;
97 sizeChanged = true;
98 }
99
101
103
104 if (sizeChanged) {
105 int dataPointCount =
std::max(fSize.
fWidth / kPixelsPerTick + 1, 2);
106
107 for (
int i = 0;
i < kNumGraphs; ++
i) {
110 gen_data(
y, ySpread, dataPointCount, fData +
i);
111 }
112 }
113
114 canvas->
clear(0xFFE0F0E0);
115
119 for (
int i = 0;
i < kNumGraphs; ++
i) {
121 }
122 }
123
134
137
138 for (
int i = 0;
i < kNumGraphs; ++
i) {
140 prevData,
142 0,
144 fShift,
145 &plotPath,
146 &fillPath);
147
148
151
154
155 prevData = fData +
i;
156 }
157
158 fShift += kShiftPerFrame;
159 }
static void gen_paths(const SkTDArray< SkScalar > &topData, const SkTDArray< SkScalar > *bottomData, SkScalar yBase, SkScalar xLeft, SkScalar xDelta, int leftShift, SkPathBuilder *plot, SkPathBuilder *fill)
static void gen_data(SkScalar yAvg, SkScalar ySpread, int count, SkTDArray< SkScalar > *dataPts)
static const SkColor gColors[]
virtual SkISize getBaseLayerSize() const
void clear(SkColor color)
void drawPath(const SkPath &path, const SkPaint &paint)
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setStrokeCap(Cap cap)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
void setStrokeJoin(Join join)
void setStrokeWidth(SkScalar width)
static float max(float r, float g, float b)