| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 scoped_refptr<FakeDisplayListRasterSource> | 23 scoped_refptr<FakeDisplayListRasterSource> |
| 24 FakeDisplayListRasterSource::CreateFilled(const gfx::Size& size) { | 24 FakeDisplayListRasterSource::CreateFilled(const gfx::Size& size) { |
| 25 auto recording_source = | 25 auto recording_source = |
| 26 FakeDisplayListRecordingSource::CreateFilledRecordingSource(size); | 26 FakeDisplayListRecordingSource::CreateFilledRecordingSource(size); |
| 27 | 27 |
| 28 SkPaint red_paint; | 28 SkPaint red_paint; |
| 29 red_paint.setColor(SK_ColorRED); | 29 red_paint.setColor(SK_ColorRED); |
| 30 recording_source->add_draw_rect_with_paint(gfx::Rect(size), red_paint); | 30 recording_source->add_draw_rect_with_paint(gfx::Rect(size), red_paint); |
| 31 | 31 |
| 32 // TODO(wkorman): enne@ has various changes here that look like they're just |
| 33 // hacks to test specific performance items. Omitting for now. See |
| 34 // http://crrev.com/1459003003 for detail. |
| 35 |
| 32 gfx::Size smaller_size(size.width() - 10, size.height() - 10); | 36 gfx::Size smaller_size(size.width() - 10, size.height() - 10); |
| 33 SkPaint green_paint; | 37 SkPaint green_paint; |
| 34 green_paint.setColor(SK_ColorGREEN); | 38 green_paint.setColor(SK_ColorGREEN); |
| 35 recording_source->add_draw_rect_with_paint(gfx::Rect(smaller_size), | 39 recording_source->add_draw_rect_with_paint(gfx::Rect(smaller_size), |
| 36 green_paint); | 40 green_paint); |
| 37 | 41 |
| 38 recording_source->Rerecord(); | 42 recording_source->Rerecord(); |
| 39 | 43 |
| 40 return make_scoped_refptr( | 44 return make_scoped_refptr( |
| 41 new FakeDisplayListRasterSource(recording_source.get(), false)); | 45 new FakeDisplayListRasterSource(recording_source.get(), false)); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 const gfx::Rect& canvas_bitmap_rect, | 153 const gfx::Rect& canvas_bitmap_rect, |
| 150 const gfx::Rect& canvas_playback_rect, | 154 const gfx::Rect& canvas_playback_rect, |
| 151 float contents_scale) const { | 155 float contents_scale) const { |
| 152 if (playback_allowed_event_) | 156 if (playback_allowed_event_) |
| 153 playback_allowed_event_->Wait(); | 157 playback_allowed_event_->Wait(); |
| 154 DisplayListRasterSource::PlaybackToCanvas( | 158 DisplayListRasterSource::PlaybackToCanvas( |
| 155 canvas, canvas_bitmap_rect, canvas_playback_rect, contents_scale); | 159 canvas, canvas_bitmap_rect, canvas_playback_rect, contents_scale); |
| 156 } | 160 } |
| 157 | 161 |
| 158 } // namespace cc | 162 } // namespace cc |
| OLD | NEW |