Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3524)

Unified Diff: cc/trees/layer_tree_host_pixeltest_filters.cc

Issue 1959033002: cc: optimize Skia image filter application via SkImage::makeWithFilter(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Win pixeltest tweakage Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/data/rotated_filter_gl.png ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_pixeltest_filters.cc
diff --git a/cc/trees/layer_tree_host_pixeltest_filters.cc b/cc/trees/layer_tree_host_pixeltest_filters.cc
index bfa8f81d312a4fe7c9c5a1980c838ce31f57d703..4a92bcada90d36c006f1b9c8f1d0642562645038 100644
--- a/cc/trees/layer_tree_host_pixeltest_filters.cc
+++ b/cc/trees/layer_tree_host_pixeltest_filters.cc
@@ -609,8 +609,8 @@ class RotatedDropShadowFilterTest : public LayerTreeHostFiltersPixelTest {
background->AddChild(child);
#if defined(OS_WIN)
- // Windows has 2 pixels off by 1: crbug.com/259915
- float percentage_pixels_large_error = 0.00222223f; // 1px / (300*300)
+ // Windows has 3 pixels off by 1: crbug.com/259915
+ float percentage_pixels_large_error = 0.00333334f; // 3px / (300*300)
float percentage_pixels_small_error = 0.0f;
float average_error_allowed_in_bad_pixels = 1.f;
int large_error_allowed = 1;
@@ -746,6 +746,62 @@ TEST_F(EnlargedTextureWithCropOffsetFilter, Software) {
base::FilePath(FILE_PATH_LITERAL("enlarged_texture_on_crop_offset.png")));
}
+class BlurFilterWithClip : public LayerTreeHostFiltersPixelTest {
+ protected:
+ void RunPixelTestType(PixelTestType test_type, base::FilePath image_name) {
+ scoped_refptr<SolidColorLayer> child1 =
+ CreateSolidColorLayer(gfx::Rect(200, 200), SK_ColorBLUE);
+ scoped_refptr<SolidColorLayer> child2 =
+ CreateSolidColorLayer(gfx::Rect(20, 20, 160, 160), SK_ColorWHITE);
+ scoped_refptr<SolidColorLayer> child3 =
+ CreateSolidColorLayer(gfx::Rect(40, 40, 20, 30), SK_ColorRED);
+ scoped_refptr<SolidColorLayer> child4 =
+ CreateSolidColorLayer(gfx::Rect(60, 70, 100, 90), SK_ColorGREEN);
+ scoped_refptr<SolidColorLayer> filter_layer =
+ CreateSolidColorLayer(gfx::Rect(200, 200), SK_ColorWHITE);
+
+ filter_layer->AddChild(child1);
+ filter_layer->AddChild(child2);
+ filter_layer->AddChild(child3);
+ filter_layer->AddChild(child4);
+
+ FilterOperations filters;
+ filters.Append(FilterOperation::CreateBlurFilter(2.f));
+ filter_layer->SetFilters(filters);
+
+ // Force the allocation a larger textures.
+ set_enlarge_texture_amount(gfx::Vector2d(50, 50));
+
+#if defined(OS_WIN)
+ // Windows has 1880 pixels off by 1: crbug.com/259915
+ float percentage_pixels_large_error = 4.7f; // 1880px / (200*200)
+ float percentage_pixels_small_error = 0.0f;
+ float average_error_allowed_in_bad_pixels = 1.f;
+ int large_error_allowed = 2;
+ int small_error_allowed = 0;
+ pixel_comparator_.reset(new FuzzyPixelComparator(
+ true, // discard_alpha
+ percentage_pixels_large_error, percentage_pixels_small_error,
+ average_error_allowed_in_bad_pixels, large_error_allowed,
+ small_error_allowed));
+#endif
+
+ RunPixelTest(test_type, filter_layer, image_name);
+ }
+};
+
+TEST_F(BlurFilterWithClip, GL) {
+ RunPixelTestType(
+ PIXEL_TEST_GL,
+ base::FilePath(FILE_PATH_LITERAL("blur_filter_with_clip_gl.png")));
+}
+
+TEST_F(BlurFilterWithClip, Software) {
+ RunPixelTestType(
+ PIXEL_TEST_SOFTWARE,
+ base::FilePath(FILE_PATH_LITERAL("blur_filter_with_clip_sw.png")));
+}
+
class FilterWithGiantCropRectPixelTest : public LayerTreeHostFiltersPixelTest {
protected:
scoped_refptr<SolidColorLayer> BuildFilterWithGiantCropRect(
« no previous file with comments | « cc/test/data/rotated_filter_gl.png ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698