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:
parent
289d36f905
commit
c126191fd1
@ -9,20 +9,20 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
fmt = '''
|
fmt = '''
|
||||||
target_cpu = "{arch}"
|
target_cpu = "{arch}"
|
||||||
is_debug = false
|
is_debug = {debug}
|
||||||
ndk = "{ndk}"
|
ndk = "{android_ndk_dir}"
|
||||||
ndk_api = {api_level}
|
ndk_api = {api_level}
|
||||||
skia_enable_fontmgr_empty = true
|
skia_enable_fontmgr_empty = true
|
||||||
skia_enable_pdf = false
|
skia_enable_pdf = false
|
||||||
skia_skqp_global_error_tolerance = 4
|
skia_skqp_global_error_tolerance = 4
|
||||||
skia_use_dng_sdk = false
|
skia_use_dng_sdk = false
|
||||||
skia_use_expat = false
|
skia_use_expat = false
|
||||||
skia_use_icu = false
|
skia_use_icu = false
|
||||||
skia_use_libheif = false
|
skia_use_libheif = false
|
||||||
skia_use_lua = false
|
skia_use_lua = false
|
||||||
skia_use_piex = false
|
skia_use_piex = false
|
||||||
skia_use_skcms = false
|
skia_use_skcms = false
|
||||||
skia_skqp_enable_driver_correctness_workarounds = {enable_workarounds}
|
skia_skqp_enable_driver_correctness_workarounds = {enable_workarounds}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -36,25 +36,23 @@ def parse_args():
|
|||||||
default=26, help='android API level, defaults to 26')
|
default=26, help='android API level, defaults to 26')
|
||||||
parser.add_argument('--enable_workarounds', default=False,
|
parser.add_argument('--enable_workarounds', default=False,
|
||||||
action='store_true', help="enable GPU work-arounds, defaults to 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 = 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
|
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):
|
if not os.path.exists(out_dir):
|
||||||
os.makedirs(out_dir)
|
os.makedirs(out_dir)
|
||||||
with open(os.path.join(out_dir, 'args.gn'), 'w') as o:
|
with open(os.path.join(out_dir, 'args.gn'), 'w') as o:
|
||||||
o.write(fmt.format(ndk=os.path.abspath(ndk),
|
o.write(fmt.format(**args))
|
||||||
arch=arch,
|
|
||||||
api_level=api_level,
|
|
||||||
enable_workarounds=enable_workarounds))
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
make_args_gn(args.target_build_dir,
|
make_args_gn(args.target_build_dir, vars(args))
|
||||||
args.android_ndk_dir,
|
|
||||||
args.arch,
|
|
||||||
args.api_level,
|
|
||||||
args.enable_workarounds)
|
|
||||||
|
@ -77,13 +77,13 @@ static int get_error_with_nearby(int x, int y, const SkPixmap& pm,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void skipBad() {
|
void skipBad() {
|
||||||
do {
|
while (curr < 8) {
|
||||||
SkIPoint p = this->get();
|
SkIPoint p = this->get();
|
||||||
if (p.x() >= 0 && p.y() >= 0 && p.x() < w && p.y() < h) {
|
if (p.x() >= 0 && p.y() >= 0 && p.x() < w && p.y() < h) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
++curr;
|
++curr;
|
||||||
} while (curr < 8);
|
}
|
||||||
curr = -1;
|
curr = -1;
|
||||||
}
|
}
|
||||||
void operator++() {
|
void operator++() {
|
||||||
|
Loading…
Reference in New Issue
Block a user