SkQP: debug option, and fix a bug

Change-Id: I642c65815fdab5adcd7735956e1955ede8ff229a
Reviewed-on: https://skia-review.googlesource.com/106805
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2018-02-12 15:54:40 -05:00 committed by Skia Commit-Bot
parent 289d36f905
commit c126191fd1
2 changed files with 25 additions and 27 deletions

View File

@ -9,20 +9,20 @@ import os
import sys
fmt = '''
target_cpu = "{arch}"
is_debug = false
ndk = "{ndk}"
ndk_api = {api_level}
skia_enable_fontmgr_empty = true
skia_enable_pdf = false
target_cpu = "{arch}"
is_debug = {debug}
ndk = "{android_ndk_dir}"
ndk_api = {api_level}
skia_enable_fontmgr_empty = true
skia_enable_pdf = false
skia_skqp_global_error_tolerance = 4
skia_use_dng_sdk = false
skia_use_expat = false
skia_use_icu = false
skia_use_libheif = false
skia_use_lua = false
skia_use_piex = false
skia_use_skcms = false
skia_use_dng_sdk = false
skia_use_expat = false
skia_use_icu = false
skia_use_libheif = false
skia_use_lua = false
skia_use_piex = false
skia_use_skcms = false
skia_skqp_enable_driver_correctness_workarounds = {enable_workarounds}
'''
@ -36,25 +36,23 @@ def parse_args():
default=26, help='android API level, defaults to 26')
parser.add_argument('--enable_workarounds', default=False,
action='store_true', help="enable GPU work-arounds, defaults to false")
parser.add_argument('--debug', default=False, action='store_true',
help='compile native code in debug mode, defaults to false')
# parse the args and convert enable_workarounds to string.
# parse the args and convert bools to strings.
args = parser.parse_args()
args.enable_workarounds = 'true' if args.enable_workarounds else 'false'
gn_bool = lambda b : 'true' if b else 'false'
args.enable_workarounds = gn_bool(args.enable_workarounds)
args.debug = gn_bool(args.debug)
args.android_ndk_dir = os.path.abspath(args.android_ndk_dir)
return args
def make_args_gn(out_dir, ndk, arch, api_level, enable_workarounds):
def make_args_gn(out_dir, args):
if not os.path.exists(out_dir):
os.makedirs(out_dir)
with open(os.path.join(out_dir, 'args.gn'), 'w') as o:
o.write(fmt.format(ndk=os.path.abspath(ndk),
arch=arch,
api_level=api_level,
enable_workarounds=enable_workarounds))
o.write(fmt.format(**args))
if __name__ == '__main__':
args = parse_args()
make_args_gn(args.target_build_dir,
args.android_ndk_dir,
args.arch,
args.api_level,
args.enable_workarounds)
make_args_gn(args.target_build_dir, vars(args))

View File

@ -77,13 +77,13 @@ static int get_error_with_nearby(int x, int y, const SkPixmap& pm,
}
}
void skipBad() {
do {
while (curr < 8) {
SkIPoint p = this->get();
if (p.x() >= 0 && p.y() >= 0 && p.x() < w && p.y() < h) {
return;
}
++curr;
} while (curr < 8);
}
curr = -1;
}
void operator++() {