| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "cc/layers/content_layer_client.h" | 6 #include "cc/layers/content_layer_client.h" |
| 7 #include "cc/layers/picture_image_layer.h" | 7 #include "cc/layers/picture_image_layer.h" |
| 8 #include "cc/layers/picture_layer.h" | 8 #include "cc/layers/picture_layer.h" |
| 9 #include "cc/layers/solid_color_layer.h" | 9 #include "cc/layers/solid_color_layer.h" |
| 10 #include "cc/test/layer_tree_pixel_resource_test.h" | 10 #include "cc/test/layer_tree_pixel_resource_test.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 gfx::Size mask_bounds(256, 256); | 388 gfx::Size mask_bounds(256, 256); |
| 389 CircleContentLayerClient mask_client(mask_bounds); | 389 CircleContentLayerClient mask_client(mask_bounds); |
| 390 scoped_refptr<PictureLayer> mask = PictureLayer::Create(&mask_client); | 390 scoped_refptr<PictureLayer> mask = PictureLayer::Create(&mask_client); |
| 391 mask->SetBounds(mask_bounds); | 391 mask->SetBounds(mask_bounds); |
| 392 mask->SetIsDrawable(true); | 392 mask->SetIsDrawable(true); |
| 393 mask->SetIsMask(true); | 393 mask->SetIsMask(true); |
| 394 blur->SetMaskLayer(mask.get()); | 394 blur->SetMaskLayer(mask.get()); |
| 395 | 395 |
| 396 float percentage_pixels_large_error = 2.5f; // 2.5%, ~1600px / (256*256) | 396 float percentage_pixels_large_error = 2.5f; // 2.5%, ~1600px / (256*256) |
| 397 float percentage_pixels_small_error = 0.0f; | 397 float percentage_pixels_small_error = 0.0f; |
| 398 float average_error_allowed_in_bad_pixels = 60.0f; | 398 float average_error_allowed_in_bad_pixels = 100.0f; |
| 399 int large_error_allowed = 100; | 399 int large_error_allowed = 256; |
| 400 int small_error_allowed = 0; | 400 int small_error_allowed = 0; |
| 401 pixel_comparator_.reset(new FuzzyPixelComparator( | 401 pixel_comparator_.reset(new FuzzyPixelComparator( |
| 402 true, // discard_alpha | 402 true, // discard_alpha |
| 403 percentage_pixels_large_error, | 403 percentage_pixels_large_error, |
| 404 percentage_pixels_small_error, | 404 percentage_pixels_small_error, |
| 405 average_error_allowed_in_bad_pixels, | 405 average_error_allowed_in_bad_pixels, |
| 406 large_error_allowed, | 406 large_error_allowed, |
| 407 small_error_allowed)); | 407 small_error_allowed)); |
| 408 | 408 |
| 409 RunPixelResourceTest(background, | 409 RunPixelResourceTest(background, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 RunPixelResourceTest(background, | 460 RunPixelResourceTest(background, |
| 461 base::FilePath( | 461 base::FilePath( |
| 462 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); | 462 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); |
| 463 } | 463 } |
| 464 | 464 |
| 465 } // namespace | 465 } // namespace |
| 466 } // namespace cc | 466 } // namespace cc |
| 467 | 467 |
| 468 #endif // !defined(OS_WIN) | 468 #endif // !defined(OS_WIN) |
| 469 #endif // !defined(OS_ANDROID) | 469 #endif // !defined(OS_ANDROID) |
| OLD | NEW |