mirror of
https://github.com/openharmony/graphic_utils.git
synced 2026-07-01 21:44:51 -04:00
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:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user