aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-04-28 20:22:26 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-04-28 20:22:26 +0000
commit102a692d2fe3b0d3a7218a81a383db1618dc5b98 (patch)
treecfcc4a166b3da6b20fb8fcc406731977e9c1ff25
parent2c65d1bd2bbacefe98391c8205514efcf7847a10 (diff)
parent0bf9256bb3b89abaec28280c7d1bd5078c448275 (diff)
downloadskqp-102a692d2fe3b0d3a7218a81a383db1618dc5b98.tar.gz
Change-Id: I1aca56e0aa0c11ff56cca4237c7c2461c5ef6eb5
-rw-r--r--Android.bp1
-rw-r--r--platform_tools/android/apps/skqp/src/main/Android.bp24
-rw-r--r--platform_tools/android/apps/skqp/src/main/Android.mk18
-rw-r--r--platform_tools/android/apps/skqp/src/main/assets/skqp/rendertests.txt55
-rw-r--r--platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java42
-rw-r--r--src/gpu/vk/GrVkCaps.cpp41
-rw-r--r--src/gpu/vk/GrVkGpu.cpp15
-rw-r--r--tests/VkHardwareBufferTest.cpp3
-rwxr-xr-xtools/skqp/gn_to_bp.py3
9 files changed, 73 insertions, 129 deletions
diff --git a/Android.bp b/Android.bp
index 9888fc739b..ae3406e566 100644
--- a/Android.bp
+++ b/Android.bp
@@ -15,6 +15,7 @@ cc_library_shared {
"-D_FORTIFY_SOURCE=1",
"-Wall",
"-Werror",
+ "-Weverything",
"-Wextra",
"-Winit-self",
"-Wno-bad-function-cast",
diff --git a/platform_tools/android/apps/skqp/src/main/Android.bp b/platform_tools/android/apps/skqp/src/main/Android.bp
deleted file mode 100644
index 8a567e6e48..0000000000
--- a/platform_tools/android/apps/skqp/src/main/Android.bp
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2019 Google LLC.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-android_test {
- name: "CtsSkQPTestCases",
- defaults: ["cts_defaults"],
-
- test_suites: [
- "cts",
- "vts",
- "general-tests",
- ],
- libs: ["android.test.runner.stubs"],
- jni_libs: ["libskqp_app"],
- compile_multilib: "both",
-
- static_libs: [
- "android-support-design",
- "ctstestrunner-axt",
- ],
- srcs: ["java/**/*.java"],
- sdk_version: "test_current",
-}
diff --git a/platform_tools/android/apps/skqp/src/main/Android.mk b/platform_tools/android/apps/skqp/src/main/Android.mk
new file mode 100644
index 0000000000..18f4a5548a
--- /dev/null
+++ b/platform_tools/android/apps/skqp/src/main/Android.mk
@@ -0,0 +1,18 @@
+# Copyright 2019 Google LLC.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE_TAGS := tests optional
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
+LOCAL_JNI_SHARED_LIBRARIES := libskqp_app
+LOCAL_MULTILIB := both
+LOCAL_USE_AAPT2 := true
+LOCAL_STATIC_ANDROID_LIBRARIES := android-support-design
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
+LOCAL_SRC_FILES := $(call all-java-files-under, java)
+LOCAL_PACKAGE_NAME := CtsSkQPTestCases
+LOCAL_SDK_VERSION := test_current
+include $(BUILD_CTS_PACKAGE)
diff --git a/platform_tools/android/apps/skqp/src/main/assets/skqp/rendertests.txt b/platform_tools/android/apps/skqp/src/main/assets/skqp/rendertests.txt
index 14fa55a3ae..b2b3d6d013 100644
--- a/platform_tools/android/apps/skqp/src/main/assets/skqp/rendertests.txt
+++ b/platform_tools/android/apps/skqp/src/main/assets/skqp/rendertests.txt
@@ -28,7 +28,7 @@ arcofzorro,-1
arcs_as_paths,-1
arcto,-1
arithmode,0
-atlastext,2
+atlastext,0
b_119394958,-1
badpaint,-1
bezier_conic_effects,-1
@@ -39,8 +39,8 @@ big_rrect_circular_corner_aa_effect,-1
big_rrect_ellipse_aa_effect,-1
big_rrect_elliptical_corner_aa_effect,-1
big_rrect_rect_aa_effect,-1
-bigbitmaprect_i,1
-bigbitmaprect_s,1
+bigbitmaprect_i,0
+bigbitmaprect_s,0
bigblurs,-1
bigconic,-1
bigmatrix,-1
@@ -76,7 +76,7 @@ blur_ignore_xform_rect,-1
blur_ignore_xform_rrect,-1
blur_image,-1
blurcircles,-1
-blurcircles2,1000
+blurcircles2,0
blurimagevmask,-1
blurquickreject,-1
blurrect_gallery,0
@@ -86,14 +86,14 @@ blurroundrect-WH-100x100-unevenCorners,-1
blurs,-1
bmp_filter_quality_repeat,-1
bug339297,0
-bug339297_as_clip,1
+bug339297_as_clip,0
bug5099,-1
bug5252,-1
bug530095,-1
bug583299,0
bug591993,0
bug593049,0
-bug6083,1
+bug6083,0
bug615686,-1
bug6643,0
bug6783,0
@@ -121,7 +121,7 @@ clip_region,0
clip_strokerect,-1
clipcubic,-1
clipdrawdraw,0
-cliperror,3600
+cliperror,0
clipped-bitmap-shaders-clamp,0
clipped-bitmap-shaders-clamp-hq,0
clipped-bitmap-shaders-mirror,0
@@ -140,8 +140,8 @@ coloremoji_blendmodes,0
colorfilteralpha8,0
colorfilterimagefilter,0
colorfilterimagefilter_layer,0
-colorfiltershader,50000
-colormatrix,200
+colorfiltershader,0
+colormatrix,0
colorwheel,0
colorwheelnative,0
combinemaskfilter,0
@@ -170,7 +170,7 @@ composeshader,0
composeshader_alpha,0
composeshader_bitmap,0
composeshader_bitmap2,-1
-composeshader_grid,1
+composeshader_grid,0
concavepaths,-1
conicpaths,-1
const_color_processor,-1
@@ -357,7 +357,7 @@ gradients_no_texture_nodither,-1
gradients_nodither,-1
gradients_view_perspective,-1
gradients_view_perspective_nodither,-1
-gradtext,1
+gradtext,0
grayscalejpg,0
hairlines,-1
hairmodes,-1
@@ -380,9 +380,9 @@ imagealphathreshold_crop,0
imagealphathreshold_image,-1
imagealphathreshold_surface,0
imageblur,-1
-imageblur2,2
+imageblur2,0
imageblur_large,0
-imageblurclampmode,1
+imageblurclampmode,0
imageblurrepeatmode,0
imageblurtiled,0
imagefilters_xfermodes,-1
@@ -390,7 +390,7 @@ imagefiltersbase,-1
imagefiltersclipped,-1
imagefilterscropexpand,-1
imagefilterscropped,-1
-imagefiltersgraph,1
+imagefiltersgraph,0
imagefiltersscaled,-1
imagefiltersstroked,-1
imagefilterstransformed,-1
@@ -410,7 +410,7 @@ internal_links,-1
inverse_paths,-1
jpg-color-cube,0
largecircle,-1
-largeglyphblur,3000
+largeglyphblur,0
lattice,-1
lattice2,0
lattice_alpha,0
@@ -422,8 +422,8 @@ lighting,-1
lightingcolorfilter,0
lightingshader,0
lightingshader2,-1
-linear_gradient,110000
-linear_gradient_nodither,120000
+linear_gradient,0
+linear_gradient_nodither,0
linear_gradient_tiny,0
lineclosepath,-1
linepath,-1
@@ -446,9 +446,9 @@ manyrrects,-1
matrixconvolution,-1
matrixconvolution_color,-1
matriximagefilter,-1
-megalooper_0x0,1
-megalooper_1x4,1
-megalooper_4x1,1
+megalooper_0x0,0
+megalooper_1x4,0
+megalooper_4x1,0
mipmap,-1
mipmap_gray8_srgb,0
mipmap_srgb,0
@@ -480,7 +480,7 @@ nonclosedpaths,-1
not_native32_bitmap_config,0
offsetimagefilter,0
onebadarc,0
-orientation,1
+orientation,0
ovals,-1
ovals_as_paths,-1
overdrawcolorfilter,0
@@ -533,6 +533,7 @@ radial_gradient3_nodither,0
radial_gradient4,-1
radial_gradient4_nodither,-1
radial_gradient_precision,-1
+readpixels,0
readpixelscodec,0
readpixelspicture,0
recordopts,0
@@ -563,11 +564,11 @@ savelayer_with_backdrop,-1
scale-pixels,0
scaled_tilemode_bitmap,0
scaled_tilemode_gradient,0
-scaled_tilemodes,1
+scaled_tilemodes,0
scaled_tilemodes_npot,-1
-scaledemoji,1
+scaledemoji,0
scaledemoji_rendering,-1
-scaledemojipos,1
+scaledemojipos,0
scaledstrokes,-1
scalepixels_unpremul,0
shadermaskfilter_gradient,-1
@@ -619,7 +620,7 @@ smallarc,-1
smallpaths,-1
spritebitmap,0
squarehair,-1
-srcmode,1
+srcmode,0
srgb_colorfilter,0
stlouisarch,-1
stringart,-1
@@ -645,7 +646,7 @@ teenyStrokes,-1
testgradient,-1
text_scale_skew,-1
textblob,-1
-textblob_intercepts,1
+textblob_intercepts,0
textblobblockreordering,0
textblobcolortrans,0
textblobgeometrychange,-1
@@ -699,7 +700,7 @@ windowrectangles,-1
windowrectangles_mask,-1
xfermodeimagefilter,-1
xfermodes,-1
-xfermodes2,1
+xfermodes2,0
xfermodes3,0
yuv_nv12_to_rgb_effect,-1
yuv_to_rgb_effect,-1
diff --git a/platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java b/platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java
index e65d618d7d..8e360c8840 100644
--- a/platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java
+++ b/platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java
@@ -29,7 +29,6 @@ import org.junit.runner.notification.RunNotifier;
public class SkQPRunner extends Runner implements Filterable {
private int mShouldRunTestCount;
private Description[] mTests;
- private Description mDescription;
private boolean[] mShouldSkipTest;
private String mOutputDirectory;
private SkQP mImpl;
@@ -53,9 +52,8 @@ public class SkQPRunner extends Runner implements Filterable {
AssetManager assetManager = context.getResources().getAssets();
mImpl.nInit(assetManager, mOutputDirectory);
- int totalCount = mImpl.mUnitTests.length + mImpl.mGMs.length * mImpl.mBackends.length;
- mTests = new Description[totalCount];
- mShouldSkipTest = new boolean[totalCount]; // = {false, false, ....};
+ mTests = new Description[this.testCount()];
+ mShouldSkipTest = new boolean[mTests.length]; // = {false, false, ....};
int index = 0;
for (int backend = 0; backend < mImpl.mBackends.length; backend++) {
for (int gm = 0; gm < mImpl.mGMs.length; gm++) {
@@ -67,35 +65,37 @@ public class SkQPRunner extends Runner implements Filterable {
mTests[index++] = Description.createTestDescription(SkQPRunner.class,
"unitTest_" + mImpl.mUnitTests[unitTest]);
}
- assert(index == totalCount);
- this.updateDescription(null);
+ assert(index == mTests.length);
+ mShouldRunTestCount = mTests.length;
}
- private void updateDescription(Filter filter) {
- mShouldRunTestCount = 0;
- mDescription = Description.createSuiteDescription(SkQP.class);
- assert(mTests.length == mShouldSkipTest.length);
+ @Override
+ public void filter(Filter filter) throws NoTestsRemainException {
+ int count = 0;
for (int i = 0; i < mTests.length; ++i) {
- boolean doRunTest = filter != null ? filter.shouldRun(mTests[i]) : true;
- mShouldSkipTest[i] = !doRunTest;
- if (doRunTest) {
- mDescription.addChild(mTests[i]);
- ++mShouldRunTestCount;
+ mShouldSkipTest[i] = !filter.shouldRun(mTests[i]);
+ if (!mShouldSkipTest[i]) {
+ ++count;
}
}
+ mShouldRunTestCount = count;
+ if (0 == count) {
+ throw new NoTestsRemainException();
+ }
}
@Override
- public void filter(Filter filter) throws NoTestsRemainException {
- this.updateDescription(filter);
- if (0 == mShouldRunTestCount) {
- throw new NoTestsRemainException();
+ public Description getDescription() {
+ Description d = Description.createSuiteDescription(SkQP.class);
+ for (int i = 0; i < mTests.length; ++i) {
+ d.addChild(mTests[i]);
}
+ return d;
}
@Override
- public Description getDescription() {
- return mDescription;
+ public int testCount() {
+ return mImpl.mUnitTests.length + mImpl.mGMs.length * mImpl.mBackends.length;
}
@Override
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index dabdda76a6..a720e72bf1 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -74,44 +74,6 @@ bool GrVkCaps::initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc*
return true;
}
-static int get_compatible_format_class(GrPixelConfig config) {
- switch (config) {
- case kAlpha_8_GrPixelConfig:
- case kAlpha_8_as_Red_GrPixelConfig:
- case kGray_8_GrPixelConfig:
- case kGray_8_as_Red_GrPixelConfig:
- return 1;
- case kRGB_565_GrPixelConfig:
- case kRGBA_4444_GrPixelConfig:
- case kRG_88_GrPixelConfig:
- case kAlpha_half_GrPixelConfig:
- case kAlpha_half_as_Red_GrPixelConfig:
- return 2;
- case kRGB_888_GrPixelConfig:
- return 3;
- case kRGBA_8888_GrPixelConfig:
- case kBGRA_8888_GrPixelConfig:
- case kSRGBA_8888_GrPixelConfig:
- case kSBGRA_8888_GrPixelConfig:
- case kRGBA_1010102_GrPixelConfig:
- return 4;
- case kRGBA_half_GrPixelConfig:
- case kRG_float_GrPixelConfig:
- return 5;
- case kRGBA_float_GrPixelConfig:
- return 6;
- case kRGB_ETC1_GrPixelConfig:
- return 7;
- case kUnknown_GrPixelConfig:
- case kAlpha_8_as_Alpha_GrPixelConfig:
- case kGray_8_as_Lum_GrPixelConfig:
- SK_ABORT("Unsupported Vulkan pixel config");
- return 0;
- }
- SK_ABORT("Invalid pixel config");
- return 0;
-}
-
bool GrVkCaps::canCopyImage(GrPixelConfig dstConfig, int dstSampleCnt, GrSurfaceOrigin dstOrigin,
GrPixelConfig srcConfig, int srcSampleCnt,
GrSurfaceOrigin srcOrigin) const {
@@ -121,8 +83,7 @@ bool GrVkCaps::canCopyImage(GrPixelConfig dstConfig, int dstSampleCnt, GrSurface
// We require that all vulkan GrSurfaces have been created with transfer_dst and transfer_src
// as image usage flags.
- if (srcOrigin != dstOrigin ||
- get_compatible_format_class(srcConfig) != get_compatible_format_class(dstConfig)) {
+ if (srcOrigin != dstOrigin || GrBytesPerPixel(srcConfig) != GrBytesPerPixel(dstConfig)) {
return false;
}
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index ede31df82f..2f668051e3 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -712,14 +712,6 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, int left, int top, int widt
if (!copyTexture) {
return false;
}
-
- if (!this->vkCaps().canCopyAsBlit(tex->config(), 1, false,
- copyTexture->config(), 1, false) &&
- !this->vkCaps().canCopyAsDraw(tex->config(), SkToBool(tex->asRenderTarget()),
- copyTexture->config(), true)) {
- return false;
- }
-
uploadTexture = copyTexture.get();
uploadLeft = 0;
uploadTop = 0;
@@ -2115,15 +2107,14 @@ bool GrVkGpu::onReadPixels(GrSurface* surface, int left, int top, int width, int
if (rt) {
srcSampleCount = rt->numColorSamples();
}
- if (!this->vkCaps().canCopyAsBlit(copySurface->config(), 1, false,
- surface->config(), srcSampleCount,
- image->isLinearTiled()) &&
+ static const GrSurfaceOrigin kOrigin = kTopLeft_GrSurfaceOrigin;
+ if (!this->vkCaps().canCopyAsBlit(copySurface->config(), 1, kOrigin,
+ surface->config(), srcSampleCount, kOrigin) &&
!this->vkCaps().canCopyAsDraw(copySurface->config(), false,
surface->config(), SkToBool(surface->asTexture()))) {
return false;
}
SkIRect srcRect = SkIRect::MakeXYWH(left, top, width, height);
- static const GrSurfaceOrigin kOrigin = kTopLeft_GrSurfaceOrigin;
if (!this->copySurface(copySurface.get(), kOrigin, surface, kOrigin,
srcRect, SkIPoint::Make(0,0))) {
return false;
diff --git a/tests/VkHardwareBufferTest.cpp b/tests/VkHardwareBufferTest.cpp
index dbf9a41200..c37d1d743e 100644
--- a/tests/VkHardwareBufferTest.cpp
+++ b/tests/VkHardwareBufferTest.cpp
@@ -155,8 +155,7 @@ bool EGLTestHelper::init(skiatest::Reporter* reporter) {
!fGLCtx->gl()->hasExtension("EGL_ANDROID_get_native_client_buffer") ||
!fGLCtx->gl()->hasExtension("GL_OES_EGL_image_external") ||
!fGLCtx->gl()->hasExtension("GL_OES_EGL_image") ||
- !fGLCtx->gl()->hasExtension("EGL_KHR_fence_sync") ||
- !fGLCtx->gl()->hasExtension("EGL_ANDROID_native_fence_sync")) {
+ !fGLCtx->gl()->hasExtension("EGL_KHR_fence_sync")) {
return false;
}
diff --git a/tools/skqp/gn_to_bp.py b/tools/skqp/gn_to_bp.py
index 920c8f0e8e..d6b84955da 100755
--- a/tools/skqp/gn_to_bp.py
+++ b/tools/skqp/gn_to_bp.py
@@ -151,9 +151,6 @@ defines = {str(d) for d in js['targets']['//:libskqp_app']['defines']}
defines.update(["SK_ENABLE_DUMP_GPU", "SK_BUILD_FOR_SKQP"])
cflags_cc.update(['-Wno-extra-semi-stmt'])
-# Android does not want -Weverything set, it blocks toolchain updates.
-cflags.remove('-Weverything')
-
gn_to_bp_utils.GrabDependentValues(js, '//:libskqp_app', 'sources', srcs, None)
gn_to_bp_utils.GrabDependentValues(js, '//:libskqp_app', 'include_dirs',
local_includes, 'freetype')