| 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_raster_source.h" | 5 #include "cc/test/fake_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_recording_source.h" | 10 #include "cc/test/fake_recording_source.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateFilled( | 22 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateFilled( |
| 23 const gfx::Size& size) { | 23 const gfx::Size& size) { |
| 24 auto recording_source = | 24 auto recording_source = |
| 25 FakeRecordingSource::CreateFilledRecordingSource(size); | 25 FakeRecordingSource::CreateFilledRecordingSource(size); |
| 26 | 26 |
| 27 SkPaint red_paint; | 27 SkPaint red_paint; |
| 28 red_paint.setColor(SK_ColorRED); | 28 red_paint.setColor(SK_ColorRED); |
| 29 recording_source->add_draw_rect_with_paint(gfx::Rect(size), red_paint); | 29 recording_source->add_draw_rect_with_paint(gfx::Rect(size), red_paint); |
| 30 | 30 |
| 31 gfx::Size smaller_size(size.width() - 10, size.height() - 10); | 31 SkPaint salmon_pink_paint; |
| 32 SkPaint green_paint; | 32 salmon_pink_paint.setColor(SK_ColorRED); |
| 33 green_paint.setColor(SK_ColorGREEN); | 33 salmon_pink_paint.setAlpha(128); |
| 34 recording_source->add_draw_rect_with_paint(gfx::Rect(smaller_size), | 34 recording_source->add_draw_rect_with_paint(gfx::Rect(size), |
| 35 green_paint); | 35 salmon_pink_paint); |
| 36 | 36 |
| 37 recording_source->Rerecord(); | 37 recording_source->Rerecord(); |
| 38 | 38 |
| 39 return make_scoped_refptr( | 39 return make_scoped_refptr( |
| 40 new FakeRasterSource(recording_source.get(), false)); | 40 new FakeRasterSource(recording_source.get(), false)); |
| 41 } | 41 } |
| 42 | 42 |
| 43 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateFilledLCD( | 43 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateFilledLCD( |
| 44 const gfx::Size& size) { | 44 const gfx::Size& size) { |
| 45 auto recording_source = | 45 auto recording_source = |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 float contents_scale, | 145 float contents_scale, |
| 146 const PlaybackSettings& settings) const { | 146 const PlaybackSettings& settings) const { |
| 147 if (playback_allowed_event_) | 147 if (playback_allowed_event_) |
| 148 playback_allowed_event_->Wait(); | 148 playback_allowed_event_->Wait(); |
| 149 RasterSource::PlaybackToCanvas(canvas, canvas_bitmap_rect, | 149 RasterSource::PlaybackToCanvas(canvas, canvas_bitmap_rect, |
| 150 canvas_playback_rect, contents_scale, | 150 canvas_playback_rect, contents_scale, |
| 151 settings); | 151 settings); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace cc | 154 } // namespace cc |
| OLD | NEW |