OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "media/base/video_frame.h" | 6 #include "media/base/video_frame.h" |
7 #include "media/base/video_util.h" | 7 #include "media/base/video_util.h" |
| 8 #include "media/blink/skcanvas_video_renderer.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "media/filters/skcanvas_video_renderer.h" | |
11 | 11 |
12 using media::VideoFrame; | 12 using media::VideoFrame; |
13 | 13 |
14 namespace media { | 14 namespace media { |
15 | 15 |
16 static const int kWidth = 320; | 16 static const int kWidth = 320; |
17 static const int kHeight = 240; | 17 static const int kHeight = 240; |
18 static const gfx::Rect kNaturalRect(0, 0, kWidth, kHeight); | 18 static const gfx::Rect kNaturalRect(0, 0, kWidth, kHeight); |
19 | 19 |
20 // Helper for filling a |canvas| with a solid |color|. | 20 // Helper for filling a |canvas| with a solid |color|. |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 EXPECT_EQ(SK_ColorMAGENTA, | 499 EXPECT_EQ(SK_ColorMAGENTA, |
500 GetColorAt(&canvas, (kWidth / 2) - 1, (kHeight / 2) - 1)); | 500 GetColorAt(&canvas, (kWidth / 2) - 1, (kHeight / 2) - 1)); |
501 EXPECT_EQ(SK_ColorMAGENTA, GetColorAt(&canvas, 0, (kHeight / 2) - 1)); | 501 EXPECT_EQ(SK_ColorMAGENTA, GetColorAt(&canvas, 0, (kHeight / 2) - 1)); |
502 EXPECT_EQ(SK_ColorRED, GetColorAt(&canvas, kWidth / 2, kHeight / 2)); | 502 EXPECT_EQ(SK_ColorRED, GetColorAt(&canvas, kWidth / 2, kHeight / 2)); |
503 EXPECT_EQ(SK_ColorBLUE, GetColorAt(&canvas, kWidth - 1, kHeight / 2)); | 503 EXPECT_EQ(SK_ColorBLUE, GetColorAt(&canvas, kWidth - 1, kHeight / 2)); |
504 EXPECT_EQ(SK_ColorGREEN, GetColorAt(&canvas, kWidth - 1, kHeight - 1)); | 504 EXPECT_EQ(SK_ColorGREEN, GetColorAt(&canvas, kWidth - 1, kHeight - 1)); |
505 EXPECT_EQ(SK_ColorBLACK, GetColorAt(&canvas, kWidth / 2, kHeight - 1)); | 505 EXPECT_EQ(SK_ColorBLACK, GetColorAt(&canvas, kWidth / 2, kHeight - 1)); |
506 } | 506 } |
507 | 507 |
508 } // namespace media | 508 } // namespace media |
OLD | NEW |