| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "cc/output/gl_renderer.h" | 10 #include "cc/output/gl_renderer.h" |
| (...skipping 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2896 } | 2896 } |
| 2897 | 2897 |
| 2898 SkPaint blue_paint; | 2898 SkPaint blue_paint; |
| 2899 blue_paint.setColor(SK_ColorBLUE); | 2899 blue_paint.setColor(SK_ColorBLUE); |
| 2900 recording->add_draw_rectf_with_paint(blue_layer_rect1, blue_paint); | 2900 recording->add_draw_rectf_with_paint(blue_layer_rect1, blue_paint); |
| 2901 recording->add_draw_rectf_with_paint(blue_layer_rect2, blue_paint); | 2901 recording->add_draw_rectf_with_paint(blue_layer_rect2, blue_paint); |
| 2902 recording->Rerecord(); | 2902 recording->Rerecord(); |
| 2903 scoped_refptr<FakeRasterSource> raster_source = | 2903 scoped_refptr<FakeRasterSource> raster_source = |
| 2904 FakeRasterSource::CreateFromRecordingSource(recording.get(), false); | 2904 FakeRasterSource::CreateFromRecordingSource(recording.get(), false); |
| 2905 | 2905 |
| 2906 gfx::Rect content_rect( | |
| 2907 gfx::ScaleToEnclosingRect(layer_rect, contents_scale)); | |
| 2908 gfx::Rect content_union_rect( | 2906 gfx::Rect content_union_rect( |
| 2909 gfx::ToEnclosingRect(gfx::ScaleRect(union_layer_rect, contents_scale))); | 2907 gfx::ToEnclosingRect(gfx::ScaleRect(union_layer_rect, contents_scale))); |
| 2910 | 2908 |
| 2911 // At a scale of 4x the rectangles with a width of 2.5 will take up 10 pixels, | 2909 // At a scale of 4x the rectangles with a width of 2.5 will take up 10 pixels, |
| 2912 // so scale an additional 10x to make them 100x100. | 2910 // so scale an additional 10x to make them 100x100. |
| 2913 gfx::Transform quad_to_target_transform; | 2911 gfx::Transform quad_to_target_transform; |
| 2914 quad_to_target_transform.Scale(10.0, 10.0); | 2912 quad_to_target_transform.Scale(10.0, 10.0); |
| 2915 gfx::Rect quad_content_rect(gfx::Size(20, 20)); | 2913 gfx::Rect quad_content_rect(gfx::Size(20, 20)); |
| 2916 SharedQuadState* blue_shared_state = CreateTestSharedQuadState( | 2914 SharedQuadState* blue_shared_state = CreateTestSharedQuadState( |
| 2917 quad_to_target_transform, quad_content_rect, pass.get()); | 2915 quad_to_target_transform, quad_content_rect, pass.get()); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3176 | 3174 |
| 3177 EXPECT_TRUE(this->RunPixelTest( | 3175 EXPECT_TRUE(this->RunPixelTest( |
| 3178 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), | 3176 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), |
| 3179 FuzzyPixelOffByOneComparator(true))); | 3177 FuzzyPixelOffByOneComparator(true))); |
| 3180 } | 3178 } |
| 3181 | 3179 |
| 3182 #endif // !defined(OS_ANDROID) | 3180 #endif // !defined(OS_ANDROID) |
| 3183 | 3181 |
| 3184 } // namespace | 3182 } // namespace |
| 3185 } // namespace cc | 3183 } // namespace cc |
| OLD | NEW |