diff options
-rw-r--r-- | projects/skia/BUILD.gn.diff | 4 | ||||
-rw-r--r-- | projects/skia/Dockerfile | 2 | ||||
-rw-r--r-- | projects/skia/build.sh | 2 | ||||
-rw-r--r-- | projects/skia/region_deserialize.cpp | 39 |
4 files changed, 2 insertions, 45 deletions
diff --git a/projects/skia/BUILD.gn.diff b/projects/skia/BUILD.gn.diff index b761370b..8017cdef 100644 --- a/projects/skia/BUILD.gn.diff +++ b/projects/skia/BUILD.gn.diff @@ -13,13 +13,11 @@ # limitations under the License. # ################################################################################ -# TODO(kjlubick): Move this into Skia proper - # Append this to build.gn in the skia repo and then build the targets test_app("fuzz_region_deserialize") { sources = [ - "fuzz/oss_fuzz/region_deserialize.cpp", + "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp", ] deps = [ ":flags", diff --git a/projects/skia/Dockerfile b/projects/skia/Dockerfile index 518461b0..3daa1712 100644 --- a/projects/skia/Dockerfile +++ b/projects/skia/Dockerfile @@ -32,8 +32,6 @@ RUN python tools/git-sync-deps COPY build.sh $SRC/ -# Dirty, ugly hacks until I land the final result in Skia proper COPY region_deserialize.options $SRC/skia/region_deserialize.options COPY BUILD.gn.diff $SRC/skia/BUILD.gn.diff RUN cat BUILD.gn.diff >> BUILD.gn -COPY region_deserialize.cpp $SRC/skia/fuzz/oss_fuzz/region_deserialize.cpp diff --git a/projects/skia/build.sh b/projects/skia/build.sh index d829c13e..7dbdd378 100644 --- a/projects/skia/build.sh +++ b/projects/skia/build.sh @@ -25,7 +25,7 @@ $SRC/depot_tools/gn gen out/Fuzz\ --args='cc="'$CC'" cxx="'$CXX'" is_debug=false - extra_cflags=["'"$CXXFLAGS_ARR"'","-DIS_FUZZING", + extra_cflags=["'"$CXXFLAGS_ARR"'","-DIS_FUZZING_WITH_LIBFUZZER", "-Wno-zero-as-null-pointer-constant", "-Wno-unused-template", "-Wno-cast-qual"] skia_use_system_freetype2=false skia_use_fontconfig=false diff --git a/projects/skia/region_deserialize.cpp b/projects/skia/region_deserialize.cpp deleted file mode 100644 index cfe09f67..00000000 --- a/projects/skia/region_deserialize.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// TODO(kjlubick): Move this into Skia proper - - -#include "SkCanvas.h" -#include "SkPaint.h" -#include "SkRegion.h" -#include "SkSurface.h" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - SkRegion region; - if (!region.readFromMemory(data, size)) { - return 0; - } - region.computeRegionComplexity(); - region.isComplex(); - SkRegion r2; - if (region == r2) { - region.contains(0,0); - } else { - region.contains(1,1); - } - auto s = SkSurface::MakeRasterN32Premul(1024, 1024); - s->getCanvas()->drawRegion(region, SkPaint()); - return 0; // Non-zero return values are reserved for future use. -} |