| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/test/fake_display_list_raster_source.h" | 5 #include "cc/test/fake_display_list_raster_source.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "cc/test/fake_display_list_recording_source.h" | 10 #include "cc/test/fake_display_list_recording_source.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 new FakeDisplayListRasterSource(recording_source.get(), false)); | 75 new FakeDisplayListRasterSource(recording_source.get(), false)); |
| 76 if (!raster_source->IsSolidColor()) | 76 if (!raster_source->IsSolidColor()) |
| 77 ADD_FAILURE() << "Not solid color!"; | 77 ADD_FAILURE() << "Not solid color!"; |
| 78 return raster_source; | 78 return raster_source; |
| 79 } | 79 } |
| 80 | 80 |
| 81 scoped_refptr<FakeDisplayListRasterSource> | 81 scoped_refptr<FakeDisplayListRasterSource> |
| 82 FakeDisplayListRasterSource::CreatePartiallyFilled( | 82 FakeDisplayListRasterSource::CreatePartiallyFilled( |
| 83 const gfx::Size& size, | 83 const gfx::Size& size, |
| 84 const gfx::Rect& recorded_viewport) { | 84 const gfx::Rect& recorded_viewport) { |
| 85 DCHECK_IMPLIES(!recorded_viewport.IsEmpty(), | 85 DCHECK(recorded_viewport.IsEmpty() || |
| 86 gfx::Rect(size).Contains(recorded_viewport)); | 86 gfx::Rect(size).Contains(recorded_viewport)); |
| 87 auto recording_source = FakeDisplayListRecordingSource::CreateRecordingSource( | 87 auto recording_source = FakeDisplayListRecordingSource::CreateRecordingSource( |
| 88 recorded_viewport, size); | 88 recorded_viewport, size); |
| 89 | 89 |
| 90 SkPaint red_paint; | 90 SkPaint red_paint; |
| 91 red_paint.setColor(SK_ColorRED); | 91 red_paint.setColor(SK_ColorRED); |
| 92 recording_source->add_draw_rect_with_paint(gfx::Rect(size), red_paint); | 92 recording_source->add_draw_rect_with_paint(gfx::Rect(size), red_paint); |
| 93 | 93 |
| 94 gfx::Size smaller_size(size.width() - 10, size.height() - 10); | 94 gfx::Size smaller_size(size.width() - 10, size.height() - 10); |
| 95 SkPaint green_paint; | 95 SkPaint green_paint; |
| 96 green_paint.setColor(SK_ColorGREEN); | 96 green_paint.setColor(SK_ColorGREEN); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 const gfx::Rect& canvas_bitmap_rect, | 149 const gfx::Rect& canvas_bitmap_rect, |
| 150 const gfx::Rect& canvas_playback_rect, | 150 const gfx::Rect& canvas_playback_rect, |
| 151 float contents_scale) const { | 151 float contents_scale) const { |
| 152 if (playback_allowed_event_) | 152 if (playback_allowed_event_) |
| 153 playback_allowed_event_->Wait(); | 153 playback_allowed_event_->Wait(); |
| 154 DisplayListRasterSource::PlaybackToCanvas( | 154 DisplayListRasterSource::PlaybackToCanvas( |
| 155 canvas, canvas_bitmap_rect, canvas_playback_rect, contents_scale); | 155 canvas, canvas_bitmap_rect, canvas_playback_rect, contents_scale); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace cc | 158 } // namespace cc |
| OLD | NEW |