mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 09:10:54 +00:00
!16944 Canvas GetPixelMap Crash
Merge pull request !16944 from redermens/gitpixelmap
This commit is contained in:
commit
c3708f7cca
@ -1594,7 +1594,7 @@ bool RSRenderServiceConnection::GetPixelmap(NodeId id, const std::shared_ptr<Med
|
|||||||
std::future<bool> future = result.get_future();
|
std::future<bool> future = result.get_future();
|
||||||
RSMainThread* mainThread = mainThread_;
|
RSMainThread* mainThread = mainThread_;
|
||||||
RSUniRenderThread* renderThread = &renderThread_;
|
RSUniRenderThread* renderThread = &renderThread_;
|
||||||
auto getPixelMapTask = [id, &pixelmap, rect, drawCmdList, mainThread, renderThread, &result]() {
|
auto getPixelMapTask = [id, pixelmap, rect, drawCmdList, mainThread, renderThread, &result]() {
|
||||||
auto node = mainThread->GetContext().GetNodeMap().GetRenderNode<RSCanvasDrawingRenderNode>(id);
|
auto node = mainThread->GetContext().GetNodeMap().GetRenderNode<RSCanvasDrawingRenderNode>(id);
|
||||||
if (node == nullptr) {
|
if (node == nullptr) {
|
||||||
RS_LOGD("RSRenderServiceConnection::GetPixelmap: cannot find NodeId: [%{public}" PRIu64 "]", id);
|
RS_LOGD("RSRenderServiceConnection::GetPixelmap: cannot find NodeId: [%{public}" PRIu64 "]", id);
|
||||||
@ -1612,7 +1612,7 @@ bool RSRenderServiceConnection::GetPixelmap(NodeId id, const std::shared_ptr<Med
|
|||||||
if (drawableNode) {
|
if (drawableNode) {
|
||||||
tid = std::static_pointer_cast<DrawableV2::RSCanvasDrawingRenderNodeDrawable>(drawableNode)->GetTid();
|
tid = std::static_pointer_cast<DrawableV2::RSCanvasDrawingRenderNodeDrawable>(drawableNode)->GetTid();
|
||||||
}
|
}
|
||||||
auto getDrawablePixelmapTask = [drawableNode, &pixelmap, rect, &result, tid, drawCmdList]() {
|
auto getDrawablePixelmapTask = [drawableNode, pixelmap, rect, &result, tid, drawCmdList]() {
|
||||||
result.set_value(std::static_pointer_cast<DrawableV2::RSCanvasDrawingRenderNodeDrawable>(drawableNode)->
|
result.set_value(std::static_pointer_cast<DrawableV2::RSCanvasDrawingRenderNodeDrawable>(drawableNode)->
|
||||||
GetPixelmap(pixelmap, rect, tid, drawCmdList));
|
GetPixelmap(pixelmap, rect, tid, drawCmdList));
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user