!311 修复3516白屏

Merge pull request !311 from jiangdayuan/dev
This commit is contained in:
openharmony_ci 2022-01-26 02:31:08 +00:00 committed by Gitee
commit 2fc83b3875
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 6 additions and 5 deletions

View File

@ -141,7 +141,7 @@ void RSHardwareProcessor::Redraw(sptr<Surface>& surface, const struct PrepareCom
.height = curScreenInfo_.GetScreenHeight(),
.strideAlignment = 0x8,
.format = PIXEL_FMT_RGBA_8888, // [TODO] different soc need different format
.usage = HBM_USE_CPU_READ | HBM_USE_CPU_WRITE | HBM_USE_MEM_DMA,
.usage = HBM_USE_CPU_READ | HBM_USE_CPU_WRITE | HBM_USE_MEM_DMA | HBM_USE_MEM_FB,
.timeout = 0,
};
auto canvas = CreateCanvas(surface, requestConfig);
@ -175,4 +175,4 @@ void RSHardwareProcessor::Redraw(sptr<Surface>& surface, const struct PrepareCom
}
} // namespace Rosen
} // namespace OHOS
} // namespace OHOS

View File

@ -54,9 +54,10 @@ void RsRenderServiceUtil::DrawBuffer(SkCanvas* canvas, const SkMatrix& matrix, s
ROSEN_LOGE("RsRenderServiceUtil::DrawBuffer this buffer have no vir add or width or height is negative");
return;
}
SkColorType colorType;
colorType = buffer->GetFormat() == PIXEL_FMT_BGRA_8888 ? kBGRA_8888_SkColorType : kRGBA_8888_SkColorType;
SkImageInfo layerInfo = SkImageInfo::Make(bufferWidth, bufferHeight,
kRGBA_8888_SkColorType, kPremul_SkAlphaType);
colorType, kPremul_SkAlphaType);
SkPixmap pixmap(layerInfo, addr, layerInfo.bytesPerPixel() * bufferWidth);
SkBitmap bitmap;
float scaleX = width / static_cast<float>(bufferWidth);
@ -81,4 +82,4 @@ void RsRenderServiceUtil::DrawBuffer(SkCanvas* canvas, const SkMatrix& matrix, s
}
} // namespace Rosen
} // namespace OHOS
} // namespace OHOS