940070122a
This is an attempt to fuzz the usage of SkSurfaceCharacterization, SkDeferredDisplayRecorder, and SkDeferredDisplayList. This fuzzer first makes a surface and characterization from GrDirectContext and then create a DDL and draw it on the surface. The code is compiled with ninja and run with AFL at the speed around 600/sec The future changes will include: 1. An alternative way to create DDL: first create the surface and extract the characterization from that existing surface. 2.currently we just pass the ownership of the DDL into draw_ddl. In the future we should add a version that retains ownership of the DDL in order to fuzz the lifetime of the DDL. 3. Refactorize line 62-119 Change-Id: I9cd9736813be3abc82430bd4eeb559d6993ecbd4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303600 Commit-Queue: Zepeng Hu <zepenghu@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
20 lines
514 B
C++
20 lines
514 B
C++
/*
|
|
* Copyright 2020 Google, LLC
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#include "fuzz/Fuzz.h"
|
|
#include "src/core/SkFontMgrPriv.h"
|
|
#include "tools/fonts/TestFontMgr.h"
|
|
|
|
void fuzz_CreateDDL(Fuzz* f);
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|
gSkFontMgr_DefaultFactory = &ToolUtils::MakePortableFontMgr;
|
|
auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size));
|
|
fuzz_CreateDDL(&fuzz);
|
|
return 0;
|
|
}
|