| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "cc/input/scrollbar.h" | 9 #include "cc/input/scrollbar.h" |
| 10 #include "cc/layers/painted_scrollbar_layer.h" | 10 #include "cc/layers/painted_scrollbar_layer.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 // Let's show the bottom right of the layer, so we know the texture wasn't | 158 // Let's show the bottom right of the layer, so we know the texture wasn't |
| 159 // just cut off. | 159 // just cut off. |
| 160 layer->SetPosition( | 160 layer->SetPosition( |
| 161 gfx::PointF(-10.f * scale + 400.f, -400.f * scale + 400.f)); | 161 gfx::PointF(-10.f * scale + 400.f, -400.f * scale + 400.f)); |
| 162 | 162 |
| 163 gfx::Transform scale_transform; | 163 gfx::Transform scale_transform; |
| 164 scale_transform.Scale(scale, scale); | 164 scale_transform.Scale(scale, scale); |
| 165 layer->SetTransform(scale_transform); | 165 layer->SetTransform(scale_transform); |
| 166 | 166 |
| 167 // The inner edge is antialiased and gets off-by-one differences. | 167 // The edges are antialiased and get off-by-one differences. |
| 168 float percentage_pixels_large_error = 0.42f; | 168 float percentage_pixels_large_error = 0.80125f; |
| 169 float percentage_pixels_small_error = 0.f; | 169 float percentage_pixels_small_error = 0.f; |
| 170 float average_error_allowed_in_bad_pixels = 1.f; | 170 float average_error_allowed_in_bad_pixels = 1.f; |
| 171 int large_error_allowed = 1; | 171 int large_error_allowed = 1; |
| 172 int small_error_allowed = 0; | 172 int small_error_allowed = 0; |
| 173 pixel_comparator_.reset(new FuzzyPixelComparator( | 173 pixel_comparator_.reset(new FuzzyPixelComparator( |
| 174 true, // discard_alpha | 174 true, // discard_alpha |
| 175 percentage_pixels_large_error, percentage_pixels_small_error, | 175 percentage_pixels_large_error, percentage_pixels_small_error, |
| 176 average_error_allowed_in_bad_pixels, large_error_allowed, | 176 average_error_allowed_in_bad_pixels, large_error_allowed, |
| 177 small_error_allowed)); | 177 small_error_allowed)); |
| 178 | 178 |
| 179 RunPixelTest(PIXEL_TEST_GL, background, | 179 RunPixelTest(PIXEL_TEST_GL, background, |
| 180 base::FilePath(FILE_PATH_LITERAL("spiral_64_scale.png"))); | 180 base::FilePath(FILE_PATH_LITERAL("spiral_64_scale.png"))); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace | 183 } // namespace |
| 184 } // namespace cc | 184 } // namespace cc |
| 185 | 185 |
| 186 #endif // OS_ANDROID | 186 #endif // OS_ANDROID |
| OLD | NEW |