зеркало из https://github.com/mozilla/moz-skia.git
Fix ChartBench crash.
git-svn-id: http://skia.googlecode.com/svn/trunk@7826 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
ad51132b1b
Коммит
cd7421bf38
|
@ -94,6 +94,8 @@ public:
|
||||||
ChartBench(void* param, bool aa) : SkBenchmark(param) {
|
ChartBench(void* param, bool aa) : SkBenchmark(param) {
|
||||||
fShift = 0;
|
fShift = 0;
|
||||||
fAA = aa;
|
fAA = aa;
|
||||||
|
fSize.fWidth = -1;
|
||||||
|
fSize.fHeight = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -115,8 +117,6 @@ protected:
|
||||||
SkScalar ySpread = SkIntToScalar(fSize.fHeight / 20);
|
SkScalar ySpread = SkIntToScalar(fSize.fHeight / 20);
|
||||||
|
|
||||||
SkScalar height = SkIntToScalar(fSize.fHeight);
|
SkScalar height = SkIntToScalar(fSize.fHeight);
|
||||||
|
|
||||||
for (int frame = 0; frame < kFramesPerRun; ++frame) {
|
|
||||||
if (sizeChanged) {
|
if (sizeChanged) {
|
||||||
int dataPointCount = SkMax32(fSize.fWidth / kPixelsPerTick + 1, 2);
|
int dataPointCount = SkMax32(fSize.fWidth / kPixelsPerTick + 1, 2);
|
||||||
|
|
||||||
|
@ -125,9 +125,10 @@ protected:
|
||||||
fData[i].reset();
|
fData[i].reset();
|
||||||
gen_data(y, ySpread, dataPointCount, fData + i);
|
gen_data(y, ySpread, dataPointCount, fData + i);
|
||||||
}
|
}
|
||||||
sizeChanged = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int frame = 0; frame < kFramesPerRun; ++frame) {
|
||||||
|
|
||||||
canvas->clear(0xFFE0F0E0);
|
canvas->clear(0xFFE0F0E0);
|
||||||
|
|
||||||
static SkMWCRandom colorRand;
|
static SkMWCRandom colorRand;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче