mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 09:10:54 +00:00
commit
63c0c36b4a
@ -18,7 +18,7 @@
|
||||
<!-- maximum length of a test input -->
|
||||
<max_len>1000</max_len>
|
||||
<!-- maximum total time in seconds to run the fuzzer -->
|
||||
<max_total_time>300</max_total_time>
|
||||
<max_total_time>30</max_total_time>
|
||||
<!-- memory usage limit in Mb -->
|
||||
<rss_limit_mb>4096</rss_limit_mb>
|
||||
</fuzztest>
|
||||
|
@ -223,6 +223,8 @@ bool DoOnBoundsSizeChanged(const uint8_t* data, size_t size)
|
||||
delete RSTransactionProxy::instance_;
|
||||
RSTransactionProxy::instance_ = nullptr;
|
||||
RSCanvasNode::SharedPtr canvasNode = RSCanvasNode::Create(isRenderServiceNode, isTextureExportNode);
|
||||
BoundsChangedCallback callback = [](const Rosen::Vector4f& vector4f) {};
|
||||
canvasNode->SetBoundsChangedCallback(callback);
|
||||
canvasNode->OnBoundsSizeChanged();
|
||||
return true;
|
||||
}
|
||||
@ -248,6 +250,53 @@ bool DoSetBoundsChangedCallback(const uint8_t* data, size_t size)
|
||||
canvasNode->SetBoundsChangedCallback(callback);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DoDrawOnNode002(const uint8_t* data, size_t size)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// initialize
|
||||
DATA = data;
|
||||
g_size = size;
|
||||
g_pos = 0;
|
||||
|
||||
// test
|
||||
bool isRenderServiceNode = GetData<bool>();
|
||||
bool isTextureExportNode = GetData<bool>();
|
||||
int width = GetData<int>();
|
||||
int height = GetData<int>();
|
||||
RSCanvasNode::SharedPtr canvasNode = RSCanvasNode::Create(isRenderServiceNode, isTextureExportNode);
|
||||
RSModifierType type = RSModifierType::BOUNDS;
|
||||
DrawFunc func = [&](std::shared_ptr<Drawing::Canvas>) {};
|
||||
RSCanvasNode rsCanvasNode(isRenderServiceNode, isTextureExportNode);
|
||||
rsCanvasNode.DrawOnNode(type, func);
|
||||
rsCanvasNode.BeginRecording(width, height);
|
||||
rsCanvasNode.IsRecording();
|
||||
rsCanvasNode.FinishRecording();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DoSetFreeze002(const uint8_t* data, size_t size)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// initialize
|
||||
DATA = data;
|
||||
g_size = size;
|
||||
g_pos = 0;
|
||||
|
||||
// test
|
||||
bool isRenderServiceNode = GetData<bool>();
|
||||
bool isTextureExportNode = GetData<bool>();
|
||||
RSCanvasNode::SharedPtr canvasNode = RSCanvasNode::Create(isRenderServiceNode, isTextureExportNode);
|
||||
bool isFreeze = GetData<bool>();
|
||||
canvasNode->SetFreeze(isFreeze);
|
||||
return true;
|
||||
}
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
|
||||
@ -264,6 +313,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
OHOS::Rosen::DoSetHDRPresent(data, size);
|
||||
OHOS::Rosen::DoOnBoundsSizeChanged(data, size);
|
||||
OHOS::Rosen::DoSetBoundsChangedCallback(data, size);
|
||||
|
||||
OHOS::Rosen::DoDrawOnNode002(data, size);
|
||||
OHOS::Rosen::DoSetFreeze002(data, size);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user