rewrite includes to not need so much -Ifoo

Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This commit is contained in:
Mike Klein 2019-04-23 12:05:21 -05:00 committed by Skia Commit-Bot
parent 0c22997075
commit c0bd9f9fe5
4405 changed files with 20430 additions and 20422 deletions

147
BUILD.gn
View File

@ -97,28 +97,13 @@ if (defined(skia_settings)) {
import(skia_settings)
}
skia_public_includes = [
"include/android",
"include/atlastext",
"include/c",
"include/codec",
"include/config",
"include/core",
"include/docs",
"include/effects",
"include/encode",
"include/gpu",
"include/pathops",
"include/ports",
"include/svg",
"include/utils",
"include/utils/mac",
"third_party/skcms",
]
# Skia public API, generally provided by :skia.
config("skia_public") {
include_dirs = skia_public_includes
include_dirs = [
".",
"third_party/skcms",
"include/third_party/vulkan",
]
defines = []
if (is_component_build) {
defines += [ "SKIA_DLL" ]
@ -152,26 +137,6 @@ config("skia_private") {
visibility = [ ":*" ]
include_dirs = [
"include/private",
"src/c",
"src/codec",
"src/core",
"src/effects",
"src/fonts",
"src/image",
"src/images",
"src/lazy",
"src/opts",
"src/pathops",
"src/pdf",
"src/ports",
"src/sfnt",
"src/shaders",
"src/shaders/gradients",
"src/sksl",
"src/utils",
"src/utils/win",
"src/xml",
"third_party/etc1",
"third_party/gif",
]
@ -189,12 +154,6 @@ config("skia_private") {
}
libs = []
lib_dirs = []
if (skia_enable_gpu) {
include_dirs += [ "src/gpu" ]
if (is_skia_dev_build && skia_use_vulkan) {
include_dirs += [ "tools/gpu/vk" ]
}
}
if (skia_use_angle) {
defines += [ "SK_ANGLE" ]
}
@ -508,7 +467,7 @@ if (skia_lex) {
"src/sksl/lex/RegexNode.cpp",
"src/sksl/lex/RegexParser.cpp",
]
include_dirs = [ "src/sksl/lex" ]
include_dirs = [ "." ]
}
action("run_sksllex") {
@ -551,10 +510,7 @@ if (skia_compile_processors) {
"src/sksl/SkSLMain.cpp",
]
sources += skia_sksl_sources
include_dirs = [
"src/gpu",
"src/sksl",
]
include_dirs = [ "." ]
deps = [
":run_sksllex",
"//third_party/spirv-tools",
@ -1096,18 +1052,6 @@ if (target_cpu == "wasm") {
static_library("debugcanvas") {
public_configs = [ ":skia_public" ]
include_dirs = [
"include/gpu",
"include/private",
"src/gpu",
"src/core",
"src/sksl",
"src/shaders",
"src/utils",
"tools",
"tools/debugger",
]
sources = [
"tools/UrlDataManager.cpp",
"tools/debugger/DebugCanvas.cpp",
@ -1199,9 +1143,31 @@ group("modules") {
# Targets guarded by skia_enable_tools may use //third_party freely.
if (skia_enable_tools) {
skia_public_includes = [
"include/android",
"include/atlastext",
"include/c",
"include/codec",
"include/config",
"include/core",
"include/docs",
"include/effects",
"include/encode",
"include/gpu",
"include/pathops",
"include/ports",
"include/svg",
"include/utils",
"include/utils/mac",
"modules/sksg/include",
"modules/skshaper/include",
"modules/skottie/include",
]
# Used by gn_to_bp.py to list our public include dirs.
source_set("public") {
configs += [ ":skia_public" ]
include_dirs = skia_public_includes
}
config("skia.h_config") {
@ -1212,16 +1178,9 @@ if (skia_enable_tools) {
skia_h = "$target_gen_dir/skia.h"
script = "gn/find_headers.py"
# TODO: would be cool to not hard-code these here, but how?
module_public_includes = [
"modules/sksg/include",
"modules/skshaper/include",
"modules/skottie/include",
]
args =
[ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
[ rebase_path(skia_h, root_build_dir) ] +
rebase_path(skia_public_includes) + rebase_path(module_public_includes)
args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
[ rebase_path(skia_h, root_build_dir) ] +
rebase_path(skia_public_includes)
depfile = "$skia_h.deps"
outputs = [
skia_h,
@ -1273,13 +1232,12 @@ if (skia_enable_tools) {
template("test_lib") {
config(target_name + "_config") {
include_dirs = invoker.public_include_dirs
if (defined(invoker.public_defines)) {
defines = invoker.public_defines
}
}
source_set(target_name) {
forward_variables_from(invoker, "*", [ "public_include_dirs" ])
forward_variables_from(invoker, "*", [])
check_includes = false
public_configs = [
":" + target_name + "_config",
@ -1484,9 +1442,7 @@ if (skia_enable_tools) {
}
test_lib("gpu_tool_utils") {
public_include_dirs = []
public_defines = []
public_include_dirs += [ "tools/gpu" ]
defines = []
if (skia_enable_discrete_gpu) {
@ -1539,7 +1495,6 @@ if (skia_enable_tools) {
sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
}
public_include_dirs += [ "include/third_party/vulkan" ]
if (skia_use_vulkan) {
sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
@ -1553,14 +1508,12 @@ if (skia_enable_tools) {
}
test_lib("flags") {
public_include_dirs = [ "tools/flags" ]
sources = [
"tools/flags/CommandLineFlags.cpp",
]
}
test_lib("common_flags_config") {
public_include_dirs = [ "tools/flags" ]
sources = [
"tools/flags/CommonFlagsConfig.cpp",
]
@ -1572,7 +1525,6 @@ if (skia_enable_tools) {
]
}
test_lib("common_flags_gpu") {
public_include_dirs = [ "tools/flags" ]
sources = [
"tools/flags/CommonFlagsGpu.cpp",
]
@ -1584,7 +1536,6 @@ if (skia_enable_tools) {
]
}
test_lib("common_flags_images") {
public_include_dirs = [ "tools/flags" ]
sources = [
"tools/flags/CommonFlagsImages.cpp",
]
@ -1593,7 +1544,6 @@ if (skia_enable_tools) {
]
}
test_lib("common_flags_aa") {
public_include_dirs = [ "tools/flags" ]
sources = [
"tools/flags/CommonFlagsAA.cpp",
]
@ -1603,7 +1553,6 @@ if (skia_enable_tools) {
}
test_lib("trace") {
public_include_dirs = [ "tools/trace" ]
deps = [
":flags",
]
@ -1618,12 +1567,6 @@ if (skia_enable_tools) {
}
test_lib("tool_utils") {
public_include_dirs = [
"tools",
"tools/debugger",
"tools/fonts",
"tools/timer",
]
sources = [
"tools/AndroidSkDebugToStdOut.cpp",
"tools/CrashHandler.cpp",
@ -1673,7 +1616,6 @@ if (skia_enable_tools) {
import("gn/gm.gni")
test_lib("gm") {
public_include_dirs = [ "gm" ]
sources = gm_sources
deps = [
":flags",
@ -1691,7 +1633,6 @@ if (skia_enable_tools) {
import("gn/tests.gni")
test_lib("tests") {
public_include_dirs = [ "tests" ]
sources = tests_sources + pathops_tests_sources
if (!skia_enable_fontmgr_android) {
sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
@ -1718,7 +1659,6 @@ if (skia_enable_tools) {
import("gn/bench.gni")
test_lib("bench") {
public_include_dirs = [ "bench" ]
sources = bench_sources
deps = [
":flags",
@ -1730,9 +1670,7 @@ if (skia_enable_tools) {
}
test_lib("experimental_svg_model") {
public_include_dirs = []
if (skia_use_expat) {
public_include_dirs += [ "experimental/svg/model" ]
sources = [
"experimental/svg/model/SkSVGAttribute.cpp",
"experimental/svg/model/SkSVGAttributeParser.cpp",
@ -1767,7 +1705,6 @@ if (skia_enable_tools) {
if (skia_use_lua) {
test_lib("lua") {
public_include_dirs = []
sources = [
"src/utils/SkLua.cpp",
"src/utils/SkLuaCanvas.cpp",
@ -1823,8 +1760,6 @@ if (skia_enable_tools) {
if (target_cpu != "wasm") {
import("gn/samples.gni")
test_lib("samples") {
public_include_dirs = [ "samplecode" ]
include_dirs = [ "experimental" ]
sources = samples_sources
public_deps = [
":tool_utils",
@ -1862,7 +1797,6 @@ if (skia_enable_tools) {
]
}
test_lib("hash_and_encode") {
public_include_dirs = [ "tools" ]
sources = [
"tools/HashAndEncode.cpp",
"tools/HashAndEncode.h",
@ -2060,12 +1994,6 @@ if (skia_enable_tools) {
}
test_app("fuzz") {
include_dirs = [
"tools",
"tools/debugger",
"tools/fonts",
"src/sksl",
]
sources = [
"fuzz/Fuzz.cpp",
"fuzz/FuzzCanvas.cpp",
@ -2155,7 +2083,6 @@ if (skia_enable_tools) {
if (!is_win) {
test_lib("skqp_lib") {
public_include_dirs = [ "tools/skqp/src" ]
defines =
[ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
sources = [
@ -2216,7 +2143,6 @@ if (skia_enable_tools) {
]
libs = []
include_dirs = []
deps = [
":skia",
"modules/skottie",
@ -2246,7 +2172,6 @@ if (skia_enable_tools) {
}
test_lib("sk_app") {
public_include_dirs = [ "tools/sk_app" ]
sources = [
"tools/sk_app/CommandSet.cpp",
"tools/sk_app/GLWindowContext.cpp",
@ -2351,7 +2276,6 @@ if (skia_enable_tools) {
"tools/fiddle/examples.cpp",
"tools/fiddle/examples.h",
]
include_dirs = [ "tools" ]
if (is_win) {
cflags = [ "/wd4756" ] # Overflow in constant arithmetic
}
@ -2383,7 +2307,6 @@ if (skia_enable_tools) {
]
libs = []
include_dirs = [ "experimental" ]
deps = [
":common_flags_gpu",
":experimental_svg_model",
@ -2474,7 +2397,6 @@ if (skia_enable_tools) {
]
libs = []
include_dirs = []
deps = [
":flags",
":gpu_tool_utils",
@ -2491,7 +2413,6 @@ if (skia_enable_tools) {
"example/SkiaSDLExample.cpp",
]
libs = []
include_dirs = []
deps = [
":gpu_tool_utils",
":skia",
@ -2559,8 +2480,6 @@ if (skia_enable_tools) {
"$skia_qt_path/include",
"$skia_qt_path/include/QtCore",
"$skia_qt_path/include/QtWidgets",
"tools",
"tools/debugger",
]
deps = [
":generate_mocs",

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkAAClip.h"
#include "SkCanvas.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkRegion.h"
#include "SkString.h"
#include "SkClipOpPriv.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPath.h"
#include "include/core/SkRegion.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkAAClip.h"
#include "src/core/SkClipOpPriv.h"
////////////////////////////////////////////////////////////////////////////////
// This bench tests out AA/BW clipping via canvas' clipPath and clipRect calls

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkGradientShader.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkString.h"
#include "include/effects/SkGradientShader.h"
enum ColorPattern {
kWhite_ColorPattern,

View File

@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
#include "AndroidCodecBench.h"
#include "CodecBenchPriv.h"
#include "CommandLineFlags.h"
#include "SkAndroidCodec.h"
#include "SkBitmap.h"
#include "SkOSFile.h"
#include "bench/AndroidCodecBench.h"
#include "bench/CodecBenchPriv.h"
#include "include/codec/SkAndroidCodec.h"
#include "include/core/SkBitmap.h"
#include "src/core/SkOSFile.h"
#include "tools/flags/CommandLineFlags.h"
AndroidCodecBench::AndroidCodecBench(SkString baseName, SkData* encoded, int sampleSize)
: fData(SkRef(encoded))

View File

@ -8,12 +8,12 @@
#ifndef AndroidCodecBench_DEFINED
#define AndroidCodecBench_DEFINED
#include "Benchmark.h"
#include "SkAutoMalloc.h"
#include "SkData.h"
#include "SkImageInfo.h"
#include "SkRefCnt.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkString.h"
#include "src/core/SkAutoMalloc.h"
/**
* Time SkAndroidCodec.

View File

@ -5,9 +5,9 @@
* found in the LICENSE file.
*/
#include "BenchLogger.h"
#include "bench/BenchLogger.h"
#include "SkStream.h"
#include "include/core/SkStream.h"
BenchLogger::BenchLogger()
: fFileStream(nullptr) {}

View File

@ -9,8 +9,8 @@
#define BenchLogger_DEFINED
#include <stdio.h>
#include "SkString.h"
#include "SkTypes.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
class SkFILEWStream;

View File

@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkParse.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/utils/SkParse.h"
template BenchRegistry* BenchRegistry::gHead;

View File

@ -8,10 +8,10 @@
#ifndef Benchmark_DEFINED
#define Benchmark_DEFINED
#include "SkPoint.h"
#include "SkRefCnt.h"
#include "SkString.h"
#include "../tools/Registry.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkString.h"
#include "tools/Registry.h"
#define DEF_BENCH3(code, N) \
static BenchRegistry gBench##N([](void*) -> Benchmark* { code; });

View File

@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkString.h"
struct BezierRec {
SkCanvas* fCanvas;

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPath.h"
#include "ToolUtils.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPath.h"
#include "tools/ToolUtils.h"
enum Align {
kLeft_Align,

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkString.h"
#include "ToolUtils.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
#include "tools/ToolUtils.h"
/* Variants for bitmaps

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkString.h"
#include "SkTo.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
#include "include/private/SkTo.h"
#include "include/utils/SkRandom.h"
static void draw_into_bitmap(const SkBitmap& bm) {
const int w = bm.width();

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "BitmapRegionDecoderBench.h"
#include "CodecBenchPriv.h"
#include "SkBitmap.h"
#include "SkOSFile.h"
#include "bench/BitmapRegionDecoderBench.h"
#include "bench/CodecBenchPriv.h"
#include "include/core/SkBitmap.h"
#include "src/core/SkOSFile.h"
BitmapRegionDecoderBench::BitmapRegionDecoderBench(const char* baseName, SkData* encoded,
SkColorType colorType, uint32_t sampleSize, const SkIRect& subset)

View File

@ -8,12 +8,12 @@
#ifndef BitmapRegionDecoderBench_DEFINED
#define BitmapRegionDecoderBench_DEFINED
#include "Benchmark.h"
#include "SkBitmapRegionDecoder.h"
#include "SkData.h"
#include "SkImageInfo.h"
#include "SkRefCnt.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/android/SkBitmapRegionDecoder.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkString.h"
/**
* Benchmark Android's BitmapRegionDecoder for a particular colorType, sampleSize, and subset.

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBlendModePriv.h"
#include "SkCanvas.h"
#include "SkFont.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkString.h"
#include "SkTextBlob.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
#include "include/core/SkTextBlob.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkBlendModePriv.h"
// Benchmark that draws non-AA rects or AA text with an SkXfermode::Mode.
class XfermodeBench : public Benchmark {

View File

@ -4,14 +4,14 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBlurMask.h"
#include "SkCanvas.h"
#include "SkMaskFilter.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkBlurMask.h"
#define MINI 0.01f
#define SMALL SkIntToScalar(2)

View File

@ -5,15 +5,15 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkBlurImageFilter.h"
#include "SkOffsetImageFilter.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/effects/SkBlurImageFilter.h"
#include "include/effects/SkOffsetImageFilter.h"
#include "include/utils/SkRandom.h"
#define FILTER_WIDTH_SMALL 32
#define FILTER_HEIGHT_SMALL 32

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBlurMask.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkBlurMask.h"
#define SMALL SkIntToScalar(2)
#define REAL 1.5f

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkMaskFilter.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRect.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkRect.h"
#include "include/core/SkString.h"
class BlurRectsBench : public Benchmark {
public:

View File

@ -5,18 +5,18 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBlurMask.h"
#include "SkCanvas.h"
#include "SkColorFilter.h"
#include "SkLayerDrawLooper.h"
#include "SkMaskFilter.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkPoint.h"
#include "SkRRect.h"
#include "SkRect.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"
#include "include/core/SkString.h"
#include "include/effects/SkLayerDrawLooper.h"
#include "src/core/SkBlurMask.h"
// Large blurred RR appear frequently on web pages. This benchmark measures our
// performance in this case.

View File

@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkTDArray.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/private/SkTDArray.h"
#include "include/utils/SkRandom.h"
/**
* This is a conversion of samplecode/SampleChart.cpp into a bench. It sure would be nice to be able

View File

@ -4,13 +4,13 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkChecksum.h"
#include "SkOpts.h"
#include "SkMD5.h"
#include "SkRandom.h"
#include "SkTemplates.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/private/SkChecksum.h"
#include "include/private/SkTemplates.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkMD5.h"
#include "src/core/SkOpts.h"
enum ChecksumType {
kMD5_ChecksumType,

View File

@ -4,10 +4,10 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
/**
Benchmarks that try to emulate a particular Skia call pattern observed in Chrome.

View File

@ -10,15 +10,15 @@
// partial clears on the GPU should follow a fast path that maps to backend-specialized clear
// operations, whereas the rounded-rect clear cannot be.
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "SkCanvas.h"
#include "SkGradientShader.h"
#include "SkPaint.h"
#include "SkRect.h"
#include "SkRRect.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"
#include "include/effects/SkGradientShader.h"
#include "GrRenderTargetContext.h"
#include "src/gpu/GrRenderTargetContext.h"
static sk_sp<SkShader> make_shader() {
static const SkPoint kPts[] = {{0, 0}, {10, 10}};

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkColorSpace.h"
#include "SkImage.h"
#include "SkPictureRecorder.h"
#include "SkString.h"
#include "SkSurface.h"
#include "ToolUtils.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "tools/ToolUtils.h"
static void DrawMask(SkCanvas* canvas) {
ToolUtils::draw_checkerboard(canvas, SK_ColorTRANSPARENT, SK_ColorGREEN, 10);
@ -67,8 +67,8 @@ DEF_BENCH(return new ClipMaskBench("picture", [](int size) -> sk_sp<SkImage> {
});)
/////////
#include "SkSurface.h"
#include "SkPath.h"
#include "include/core/SkPath.h"
#include "include/core/SkSurface.h"
class RasterTileBench : public Benchmark {
sk_sp<SkSurface> fSurf;

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPath.h"
#include "SkPathOps.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPath.h"
#include "include/pathops/SkPathOps.h"
class ClipStrategyBench : public Benchmark {
public:

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkCharToGlyphCache.h"
#include "SkFont.h"
#include "SkRandom.h"
#include "SkTypeface.h"
#include "SkUTF.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkTypeface.h"
#include "include/utils/SkRandom.h"
#include "src/utils/SkCharToGlyphCache.h"
#include "src/utils/SkUTF.h"
enum {
NGLYPHS = 100

View File

@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
#include "CodecBench.h"
#include "CodecBenchPriv.h"
#include "CommandLineFlags.h"
#include "SkBitmap.h"
#include "SkCodec.h"
#include "SkOSFile.h"
#include "bench/CodecBench.h"
#include "bench/CodecBenchPriv.h"
#include "include/codec/SkCodec.h"
#include "include/core/SkBitmap.h"
#include "src/core/SkOSFile.h"
#include "tools/flags/CommandLineFlags.h"
// Actually zeroing the memory would throw off timing, so we just lie.
static DEFINE_bool(zero_init, false,

View File

@ -8,12 +8,12 @@
#ifndef CodecBench_DEFINED
#define CodecBench_DEFINED
#include "Benchmark.h"
#include "SkAutoMalloc.h"
#include "SkData.h"
#include "SkImageInfo.h"
#include "SkRefCnt.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkString.h"
#include "src/core/SkAutoMalloc.h"
/**
* Time SkCodec.

View File

@ -8,7 +8,7 @@
#ifndef CodecBenchPriv_DEFINED
#define CodecBenchPriv_DEFINED
#include "SkImageInfo.h"
#include "include/core/SkImageInfo.h"
inline const char* color_type_to_str(SkColorType colorType) {
switch (colorType) {

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkColorFilterImageFilter.h"
#include "SkColorMatrixFilter.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/effects/SkColorFilterImageFilter.h"
#include "include/effects/SkColorMatrixFilter.h"
#define FILTER_WIDTH_SMALL SkIntToScalar(32)
#define FILTER_HEIGHT_SMALL SkIntToScalar(32)

View File

@ -4,10 +4,10 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkColorData.h"
#include "SkRandom.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkString.h"
#include "include/private/SkColorData.h"
#include "include/utils/SkRandom.h"
template <bool kFast, bool kScale>
class FourByteInterpBench : public Benchmark {

View File

@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "SkCanvas.h"
#include "SkImage.h"
#include "SkRandom.h"
#include "SkSurface.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "include/utils/SkRandom.h"
enum class ClampingMode {
// Submit image set entries with the fast constraint

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
// This benchmark's runtime should be fairly constant for a given machine,
// so it can be used as a baseline to control for thermal or other throttling.

View File

@ -5,15 +5,15 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkAutoPixmapStorage.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkDraw.h"
#include "SkMatrix.h"
#include "SkPath.h"
#include "SkRasterClip.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPath.h"
#include "src/core/SkAutoPixmapStorage.h"
#include "src/core/SkDraw.h"
#include "src/core/SkRasterClip.h"
class DrawPathBench : public Benchmark {
SkPaint fPaint;

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "GrPathUtils.h"
#include "SkGeometry.h"
#include "src/core/SkGeometry.h"
#include "src/gpu/GrPathUtils.h"
class CubicKLMBench : public Benchmark {
public:

View File

@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCubicMap.h"
#include "bench/Benchmark.h"
#include "include/core/SkCubicMap.h"
class CubicMapBench : public Benchmark {
public:

View File

@ -4,16 +4,16 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkDashPathEffect.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkString.h"
#include "SkStrokeRec.h"
#include "SkTDArray.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkString.h"
#include "include/core/SkStrokeRec.h"
#include "include/effects/SkDashPathEffect.h"
#include "include/private/SkTDArray.h"
#include "include/utils/SkRandom.h"
/*

View File

@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkFont.h"
#include "SkDisplacementMapEffect.h"
#include "SkImageSource.h"
#include "SkSurface.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkSurface.h"
#include "include/effects/SkDisplacementMapEffect.h"
#include "include/effects/SkImageSource.h"
#define FILTER_WIDTH_SMALL 32
#define FILTER_HEIGHT_SMALL 32

View File

@ -4,12 +4,12 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
/**
* This bench measures the rendering time of SkCanvas::drawBitmap with different anti-aliasing /

View File

@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkRect.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkRect.h"
#include "include/core/SkString.h"
class DrawLatticeBench : public Benchmark {
public:

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "Resources.h"
#include "SkBitmap.h"
#include "SkJpegEncoder.h"
#include "SkPngEncoder.h"
#include "SkWebpEncoder.h"
#include "SkStream.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkStream.h"
#include "include/encode/SkJpegEncoder.h"
#include "include/encode/SkPngEncoder.h"
#include "include/encode/SkWebpEncoder.h"
#include "tools/Resources.h"
// Like other Benchmark subclasses, Encoder benchmarks are run by:
// nanobench --match ^Encode_

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/utils/SkRandom.h"
/**
* Draws full screen opaque rectangles. It is designed to test any optimizations in the GPU backend

View File

@ -5,16 +5,16 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkChecksum.h"
#include "SkFont.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkString.h"
#include "SkTemplates.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkString.h"
#include "include/private/SkChecksum.h"
#include "include/private/SkTemplates.h"
#include "gUniqueGlyphIDs.h"
#include "bench/gUniqueGlyphIDs.h"
#define gUniqueGlyphIDs_Sentinel 0xFFFF

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "GMBench.h"
#include "bench/GMBench.h"
GMBench::GMBench(skiagm::GM* gm) : fGM(gm) {
fName.printf("GM_%s", gm->getName());

View File

@ -7,9 +7,9 @@
#ifndef GMBench_DEFINED
#define GMBench_DEFINED
#include "Benchmark.h"
#include "SkCanvas.h"
#include "gm.h"
#include "bench/Benchmark.h"
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
/**
* Runs a GM as a benchmark by repeatedly drawing the GM.

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "SkVertices.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/core/SkVertices.h"
#include "include/utils/SkRandom.h"
// This bench simulates the calls Skia sees from various HTML5 canvas
// game bench marks

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkGeometry.h"
#include "SkRandom.h"
#include "SkRect.h"
#include "bench/Benchmark.h"
#include "include/core/SkRect.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkGeometry.h"
class GeometryBench : public Benchmark {
public:
@ -244,7 +244,7 @@ protected:
};
DEF_BENCH( return new ChopCubicAt; )
#include "SkPath.h"
#include "include/core/SkPath.h"
class ConvexityBench : public Benchmark {
SkPath fPath;

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "ccpr/GrCCFillGeometry.h"
#include "SkGeometry.h"
#include "src/core/SkGeometry.h"
#include "src/gpu/ccpr/GrCCFillGeometry.h"
static int kNumBaseLoops = 50000;

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "SkTypes.h"
#include "include/core/SkTypes.h"
#include "Benchmark.h"
#include "GrMemoryPool.h"
#include "SkRandom.h"
#include "SkTDArray.h"
#include "SkTemplates.h"
#include "bench/Benchmark.h"
#include "include/private/SkTDArray.h"
#include "include/private/SkTemplates.h"
#include "include/utils/SkRandom.h"
#include "src/gpu/GrMemoryPool.h"
#include <new>

View File

@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkImage.h"
#include "SkPaint.h"
#include "SkSurface.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkPaint.h"
#include "include/core/SkSurface.h"
class GrMipMapBench: public Benchmark {
sk_sp<SkSurface> fSurface;

View File

@ -5,15 +5,15 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
#include "GrGpuResource.h"
#include "GrGpuResourcePriv.h"
#include "GrResourceCache.h"
#include "SkCanvas.h"
#include "include/core/SkCanvas.h"
#include "include/gpu/GrContext.h"
#include "include/gpu/GrGpuResource.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrGpuResourcePriv.h"
#include "src/gpu/GrResourceCache.h"
enum {
CACHE_SIZE_COUNT = 4096,

View File

@ -4,14 +4,14 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkGradientShader.h"
#include "SkPaint.h"
#include "SkShader.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/effects/SkGradientShader.h"
struct GradData {
int fCount;

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
enum Flags {
kBig_Flag = 1 << 0,

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "SkCanvas.h"
#include "SkShader.h"
#include "SkGradientShader.h"
#include "SkString.h"
#include "SkColor.h"
#include "SkPaint.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/effects/SkGradientShader.h"
static const char* get_tilemode_name(SkTileMode tilemode) {
switch (tilemode) {

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "SkCanvas.h"
#include "SkShader.h"
#include "SkGradientShader.h"
#include "SkString.h"
#include "SkColor.h"
#include "SkPaint.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/effects/SkGradientShader.h"
class HardStopGradientBench_ScaleNumHardStops : public Benchmark {
public:

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "SkCanvas.h"
#include "SkShader.h"
#include "SkGradientShader.h"
#include "SkString.h"
#include "SkColor.h"
#include "SkPaint.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/effects/SkGradientShader.h"
enum class Kind {
k001,

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkImage.h"
#include "SkSurface.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
class Image2RasterBench : public Benchmark {
public:

View File

@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkResourceCache.h"
#include "bench/Benchmark.h"
#include "src/core/SkResourceCache.h"
namespace {
static void* gGlobalAddress;

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkImage.h"
#include "SkSurface.h"
#include "ToolUtils.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "tools/ToolUtils.h"
#include "GrContext.h"
#include "GrContextPriv.h"
#include "include/gpu/GrContext.h"
#include "src/gpu/GrContextPriv.h"
#include <utility>

View File

@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "SkCanvas.h"
#include "SkImage.h"
#include "SkRandom.h"
#include "SkSurface.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "include/utils/SkRandom.h"
/**
* Draws a small set of small images multiple times each with no overlaps so that each image could

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorFilterImageFilter.h"
#include "SkColorMatrixFilter.h"
#include "SkGradientShader.h"
#include "SkImageFilter.h"
#include "SkTableColorFilter.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImageFilter.h"
#include "include/effects/SkColorFilterImageFilter.h"
#include "include/effects/SkColorMatrixFilter.h"
#include "include/effects/SkGradientShader.h"
#include "include/effects/SkTableColorFilter.h"
// Chains several matrix color filters image filter or several
// table filter image filters and draws a bitmap.

View File

@ -5,15 +5,15 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "Resources.h"
#include "SkBlurImageFilter.h"
#include "SkCanvas.h"
#include "SkDisplacementMapEffect.h"
#include "SkImage.h"
#include "SkMergeImageFilter.h"
#include "SkOffsetImageFilter.h"
#include "SkXfermodeImageFilter.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/effects/SkBlurImageFilter.h"
#include "include/effects/SkDisplacementMapEffect.h"
#include "include/effects/SkMergeImageFilter.h"
#include "include/effects/SkOffsetImageFilter.h"
#include "include/effects/SkXfermodeImageFilter.h"
#include "tools/Resources.h"
// Exercise a blur filter connected to 5 inputs of the same merge filter.
// This bench shows an improvement in performance once cacheing of re-used

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkColorData.h"
#include "SkFixed.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
#include "include/private/SkColorData.h"
#include "include/private/SkFixed.h"
#include "include/utils/SkRandom.h"
#define TILE(x, width) (((x) & 0xFFFF) * width >> 16)

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkData.h"
#include "SkJSON.h"
#include "SkStream.h"
#include "bench/Benchmark.h"
#include "include/core/SkData.h"
#include "include/core/SkStream.h"
#include "src/utils/SkJSON.h"
#if defined(SK_BUILD_FOR_ANDROID)
static constexpr const char* kBenchFile = "/data/local/tmp/bench.json";

View File

@ -4,10 +4,10 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkLightingImageFilter.h"
#include "SkPoint3.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPoint3.h"
#include "include/effects/SkLightingImageFilter.h"
#define FILTER_WIDTH_SMALL SkIntToScalar(32)
#define FILTER_HEIGHT_SMALL SkIntToScalar(32)

View File

@ -5,15 +5,15 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "SkTArray.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/private/SkTArray.h"
#include "include/utils/SkRandom.h"
class LineBench : public Benchmark {

View File

@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkMagnifierImageFilter.h"
#include "SkRandom.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/effects/SkMagnifierImageFilter.h"
#include "include/utils/SkRandom.h"
#define FILTER_WIDTH_SMALL 32
#define FILTER_HEIGHT_SMALL 32

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkColorData.h"
#include "SkFixed.h"
#include "SkMathPriv.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
#include "include/private/SkColorData.h"
#include "include/private/SkFixed.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkMathPriv.h"
static float sk_fsel(float pred, float result_ge, float result_lt) {
return pred >= 0 ? result_ge : result_lt;
@ -601,7 +601,7 @@ DEF_BENCH( return new FixedMathBench(); )
//////////////////////////////////////////////////////////////
#include "../private/SkFloatBits.h"
#include "include/private/SkFloatBits.h"
class Floor2IntBench : public Benchmark {
enum {
ARRAY = 1000,

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkMatrix44.h"
#include "SkRandom.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkMatrix44.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
class Matrix44Bench : public Benchmark {
SkString fName;

View File

@ -4,11 +4,11 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkMatrix.h"
#include "SkMatrixUtils.h"
#include "SkRandom.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkMatrixUtils.h"
class MatrixBench : public Benchmark {
SkString fName;

View File

@ -4,12 +4,12 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkMatrixConvolutionImageFilter.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
#include "include/effects/SkMatrixConvolutionImageFilter.h"
#include "include/utils/SkRandom.h"
static const char* name(SkMatrixConvolutionImageFilter::TileMode mode) {
switch (mode) {

View File

@ -5,9 +5,9 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkTemplates.h"
#include "SkUtils.h"
#include "bench/Benchmark.h"
#include "include/private/SkTemplates.h"
#include "src/core/SkUtils.h"
template <typename T, bool kInline>
class MemsetBench : public Benchmark {

View File

@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkFont.h"
#include "SkImageSource.h"
#include "SkMergeImageFilter.h"
#include "SkSurface.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkSurface.h"
#include "include/effects/SkImageSource.h"
#include "include/effects/SkMergeImageFilter.h"
#define FILTER_WIDTH_SMALL SkIntToScalar(32)
#define FILTER_HEIGHT_SMALL SkIntToScalar(32)

View File

@ -5,9 +5,9 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkMipMap.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "src/core/SkMipMap.h"
class MipMapBench: public Benchmark {
SkBitmap fBitmap;

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkMorphologyImageFilter.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/effects/SkMorphologyImageFilter.h"
#include "include/utils/SkRandom.h"
#define SMALL SkIntToScalar(2)
#define REAL 1.5f

View File

@ -4,11 +4,11 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkMutex.h"
#include "SkSharedMutex.h"
#include "SkSpinlock.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkString.h"
#include "include/private/SkMutex.h"
#include "include/private/SkSpinlock.h"
#include "src/core/SkSharedMutex.h"
template <typename Mutex>
class MutexBench : public Benchmark {

View File

@ -5,20 +5,20 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "bench/Benchmark.h"
#include "Resources.h"
#include "SkAutoPixmapStorage.h"
#include "SkData.h"
#include "SkExecutor.h"
#include "SkFloatToDecimal.h"
#include "SkGradientShader.h"
#include "SkImage.h"
#include "SkPDFUnion.h"
#include "SkPixmap.h"
#include "SkRandom.h"
#include "SkStream.h"
#include "SkTo.h"
#include "include/core/SkData.h"
#include "include/core/SkExecutor.h"
#include "include/core/SkImage.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkStream.h"
#include "include/effects/SkGradientShader.h"
#include "include/private/SkTo.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkAutoPixmapStorage.h"
#include "src/pdf/SkPDFUnion.h"
#include "src/utils/SkFloatToDecimal.h"
#include "tools/Resources.h"
namespace {
struct WStreamWriteTextBenchmark : public Benchmark {
@ -75,10 +75,10 @@ DEF_BENCH(return new PDFScalarBench("PDFScalar_random", next_any);)
#ifdef SK_SUPPORT_PDF
#include "SkPDFBitmap.h"
#include "SkPDFDocumentPriv.h"
#include "SkPDFShader.h"
#include "SkPDFUtils.h"
#include "src/pdf/SkPDFBitmap.h"
#include "src/pdf/SkPDFDocumentPriv.h"
#include "src/pdf/SkPDFShader.h"
#include "src/pdf/SkPDFUtils.h"
namespace {
class PDFImageBench : public Benchmark {
@ -311,7 +311,7 @@ DEF_BENCH(return new WritePDFTextBenchmark;)
DEF_BENCH(return new PDFClipPathBenchmark;)
#ifdef SK_PDF_ENABLE_SLOW_TESTS
#include "SkExecutor.h"
#include "include/core/SkExecutor.h"
namespace {
void big_pdf_test(SkDocument* doc, const SkBitmap& background) {
static const char* kText[] = {

View File

@ -4,12 +4,12 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkGradientShader.h"
#include "SkPaint.h"
#include "SkPatchUtils.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
#include "include/effects/SkGradientShader.h"
#include "src/utils/SkPatchUtils.h"
/**
* This bench measures the rendering time of the call SkCanvas::drawPatch with different types of
@ -324,7 +324,7 @@ DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kBoth_VertexMode); )
//////////////////////////////////////////////
#include "SkPatchUtils.h"
#include "src/utils/SkPatchUtils.h"
class PatchUtilsBench : public Benchmark {
SkString fName;

View File

@ -5,16 +5,16 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "SkTArray.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/private/SkTArray.h"
#include "include/utils/SkRandom.h"
enum Flags {
kStroke_Flag = 1 << 0,
@ -885,7 +885,7 @@ private:
///////////////////////////////////////////////////////////////////////////////
#include "SkGeometry.h"
#include "src/core/SkGeometry.h"
class ConicBench_Chop : public Benchmark {
protected:
@ -1175,8 +1175,8 @@ DEF_BENCH( return new ConservativelyContainsBench(ConservativelyContainsBench::k
DEF_BENCH( return new ConservativelyContainsBench(ConservativelyContainsBench::kRoundRect_Type); )
DEF_BENCH( return new ConservativelyContainsBench(ConservativelyContainsBench::kOval_Type); )
#include "SkPathOps.h"
#include "SkPathPriv.h"
#include "include/pathops/SkPathOps.h"
#include "src/core/SkPathPriv.h"
DEF_BENCH( return new TightBoundsBench([](const SkPath& path){ return path.computeTightBounds();},
"priv"); )

View File

@ -4,15 +4,15 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
static int rand_pts(SkRandom& rand, SkPoint pts[4]) {
int n = rand.nextU() & 3;

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkPath.h"
#include "SkPathOps.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "SkTArray.h"
#include "bench/Benchmark.h"
#include "include/core/SkPath.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/pathops/SkPathOps.h"
#include "include/private/SkTArray.h"
#include "include/utils/SkRandom.h"
class PathOpsBench : public Benchmark {
SkString fName;

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkStrike.h"
#include "SkStrikeCache.h"
#include "ToolUtils.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkStrike.h"
#include "src/core/SkStrikeCache.h"
#include "tools/ToolUtils.h"
static constexpr int kScreenWidth = 1500;
static constexpr int kScreenHeight = 1500;

View File

@ -4,10 +4,10 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkPerlinNoiseShader.h"
#include "SkShader.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkShader.h"
#include "include/effects/SkPerlinNoiseShader.h"
class PerlinNoiseBench : public Benchmark {
SkISize fSize;

View File

@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkColor.h"
#include "SkNullCanvas.h"
#include "SkPaint.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkString.h"
#include "include/utils/SkNullCanvas.h"
class PictureNesting : public Benchmark {
public:

View File

@ -8,11 +8,11 @@
// A benchmark designed to isolate the constant overheads of picture recording.
// We record an empty picture and a picture with one draw op to force memory allocation.
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkLiteDL.h"
#include "SkLiteRecorder.h"
#include "SkPictureRecorder.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPictureRecorder.h"
#include "src/core/SkLiteDL.h"
#include "src/core/SkLiteRecorder.h"
template <int kDraws, bool kLite>
struct PictureOverheadBench : public Benchmark {

View File

@ -4,16 +4,16 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkColor.h"
#include "SkPaint.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
#include "SkPoint.h"
#include "SkRandom.h"
#include "SkRect.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
// This is designed to emulate about 4 screens of textual content

View File

@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkPolyUtils.h"
#include "bench/Benchmark.h"
#include "src/utils/SkPolyUtils.h"
class PolyUtilsBench : public Benchmark {
public:

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkString.h"
#include "ToolUtils.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkString.h"
#include "tools/ToolUtils.h"
class PremulAndUnpremulAlphaOpsBench : public Benchmark {
enum {

View File

@ -5,9 +5,9 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkRandom.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/utils/SkRandom.h"
class QuickRejectBench : public Benchmark {
enum { N = 1000000 };

View File

@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkRTree.h"
#include "SkRandom.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkRTree.h"
// confine rectangles to a smallish area, so queries generally hit something, and overlap occurs:
static const SkScalar GENERATE_EXTENTS = 1000.0f;

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorSpace.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
// Time variants of read-pixels
// [ colortype ][ alphatype ][ colorspace ]
@ -62,8 +62,8 @@ DEF_BENCH( return new ReadPixBench(kBGRA_8888_SkColorType, kPremul_SkAlphaType,
DEF_BENCH( return new ReadPixBench(kBGRA_8888_SkColorType, kUnpremul_SkAlphaType, SkColorSpace::MakeSRGB()); )
////////////////////////////////////////////////////////////////////////////////
#include "SkBitmap.h"
#include "SkPixmapPriv.h"
#include "include/core/SkBitmap.h"
#include "src/core/SkPixmapPriv.h"
class PixmapOrientBench : public Benchmark {
public:

View File

@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
#include "RecordingBench.h"
#include "SkBBHFactory.h"
#include "SkLiteDL.h"
#include "SkLiteRecorder.h"
#include "SkPictureRecorder.h"
#include "bench/RecordingBench.h"
#include "include/core/SkBBHFactory.h"
#include "include/core/SkPictureRecorder.h"
#include "src/core/SkLiteDL.h"
#include "src/core/SkLiteRecorder.h"
PictureCentricBench::PictureCentricBench(const char* name, const SkPicture* pic) : fName(name) {
// Flatten the source picture in case it's trivially nested (useless for timing).
@ -67,7 +67,7 @@ void RecordingBench::onDraw(int loops, SkCanvas*) {
}
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "SkSerialProcs.h"
#include "include/core/SkSerialProcs.h"
DeserializePictureBench::DeserializePictureBench(const char* name, sk_sp<SkData> data)
: fName(name)

View File

@ -8,9 +8,9 @@
#ifndef RecordingBench_DEFINED
#define RecordingBench_DEFINED
#include "Benchmark.h"
#include "SkPicture.h"
#include "SkLiteDL.h"
#include "bench/Benchmark.h"
#include "include/core/SkPicture.h"
#include "src/core/SkLiteDL.h"
class PictureCentricBench : public Benchmark {
public:

View File

@ -5,15 +5,15 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "CommandLineFlags.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkGradientShader.h"
#include "SkPaint.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/effects/SkGradientShader.h"
#include "include/utils/SkRandom.h"
#include "tools/flags/CommandLineFlags.h"
static DEFINE_double(strokeWidth, -1.0, "If set, use this stroke width in RectBench.");

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkRandom.h"
#include "SkSize.h"
#include "SkTDArray.h"
#include "bench/Benchmark.h"
#include "include/core/SkSize.h"
#include "include/private/SkTDArray.h"
#include "include/utils/SkRandom.h"
#include "GrRectanizer_pow2.h"
#include "GrRectanizer_skyline.h"
#include "src/gpu/GrRectanizer_pow2.h"
#include "src/gpu/GrRectanizer_skyline.h"
/**
* This bench exercises Ganesh' GrRectanizer classes. It exercises the following

View File

@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkLayerDrawLooper.h"
#include "SkMaskFilter.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/effects/SkLayerDrawLooper.h"
#include "include/utils/SkRandom.h"
// This bench replicates a problematic use case of a draw looper used
// to create an inner blurred rect

View File

@ -4,9 +4,9 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkRefCnt.h"
#include "SkWeakRefCnt.h"
#include "bench/Benchmark.h"
#include "include/core/SkRefCnt.h"
#include "include/private/SkWeakRefCnt.h"
#include <memory>
#include <new>

View File

@ -4,10 +4,10 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkRandom.h"
#include "SkRegion.h"
#include "SkString.h"
#include "bench/Benchmark.h"
#include "include/core/SkRegion.h"
#include "include/core/SkString.h"
#include "include/utils/SkRandom.h"
static bool union_proc(SkRegion& a, SkRegion& b) {
SkRegion result;

Some files were not shown because too many files have changed in this diff Show More