mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-12-21 14:20:46 +00:00
commit
2fc83b3875
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user