Description: code refact for some review

IssueNo:I5SN3D
Feature or Bugfix: Feature
Binary Source:No

Signed-off-by: jiadexiang <jiadexiang@huawei.com>
This commit is contained in:
jiadexiang
2022-09-22 22:06:22 +08:00
parent ada901136e
commit 95fa50d277
2 changed files with 3 additions and 3 deletions
@@ -45,7 +45,7 @@ bool RasterizerScanlineAntialias::SweepScanline(GeometryScanline& sl)
cover += curCell->cover;
// accumulate all cells with the same X
while (--numCells && (curCell = *++cells) && (curCell->x == x)) {
while (--numCells && (curCell = *++cells) && (curCell != nullptr) && (curCell->x == x)) {
area += curCell->area;
cover += curCell->cover;
}
@@ -58,7 +58,7 @@ bool RasterizerScanlineAntialias::SweepScanline(GeometryScanline& sl)
}
x++;
}
if (numCells && curCell->x > x) {
if (numCells && (curCell != nullptr) && curCell->x > x) {
// At this time, area is 0, that is, 0 to cover << (POLY_SUBPIXEL_SHIFT + 1)
alpha = CalculateAlpha(cover << (POLY_SUBPIXEL_SHIFT + 1));
if (alpha) {
+1 -1
View File
@@ -38,7 +38,7 @@ uint32_t HalGetCpuCoreNum()
cpuCoreNum = sysInfo.dwNumberOfProcessors;
#elif defined __LINUX__
cpuCoreNum = sysconf(_SC_NPROCESSORS_ONLN);
#elif defined HAL_CPU_NUM
#elif ((defined (HAL_CPU_NUM)) && (HAL_CPU_NUM < 8))
cpuCoreNum = HAL_CPU_NUM;
#else
cpuCoreNum = 1;