| 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/paint/paint_flags.h" |
| 10 #include "cc/test/fake_recording_source.h" | 11 #include "cc/test/fake_recording_source.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 15 | 16 |
| 16 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateInfiniteFilled() { | 17 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateInfiniteFilled() { |
| 17 gfx::Size size(std::numeric_limits<int>::max() / 10, | 18 gfx::Size size(std::numeric_limits<int>::max() / 10, |
| 18 std::numeric_limits<int>::max() / 10); | 19 std::numeric_limits<int>::max() / 10); |
| 19 return CreateFilled(size); | 20 return CreateFilled(size); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 133 |
| 133 FakeRasterSource::FakeRasterSource(const RecordingSource* recording_source, | 134 FakeRasterSource::FakeRasterSource(const RecordingSource* recording_source, |
| 134 bool can_use_lcd, | 135 bool can_use_lcd, |
| 135 base::WaitableEvent* playback_allowed_event) | 136 base::WaitableEvent* playback_allowed_event) |
| 136 : RasterSource(recording_source, can_use_lcd), | 137 : RasterSource(recording_source, can_use_lcd), |
| 137 playback_allowed_event_(playback_allowed_event) {} | 138 playback_allowed_event_(playback_allowed_event) {} |
| 138 | 139 |
| 139 FakeRasterSource::~FakeRasterSource() {} | 140 FakeRasterSource::~FakeRasterSource() {} |
| 140 | 141 |
| 141 void FakeRasterSource::PlaybackToCanvas( | 142 void FakeRasterSource::PlaybackToCanvas( |
| 142 PaintCanvas* canvas, | 143 SkCanvas* canvas, |
| 143 const PlaybackSettings& settings) const { | 144 const PlaybackSettings& settings) const { |
| 144 if (playback_allowed_event_) | 145 if (playback_allowed_event_) |
| 145 playback_allowed_event_->Wait(); | 146 playback_allowed_event_->Wait(); |
| 146 RasterSource::PlaybackToCanvas(canvas, settings); | 147 RasterSource::PlaybackToCanvas(canvas, settings); |
| 147 } | 148 } |
| 148 | 149 |
| 149 } // namespace cc | 150 } // namespace cc |
| OLD | NEW |