OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/shared_memory.h" | 6 #include "base/shared_memory.h" |
7 #include "skia/ext/platform_canvas.h" | 7 #include "skia/ext/platform_canvas.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/gfx/blit.h" | 9 #include "ui/gfx/blit.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ASSERT_EQ(expected, *bitmap.getAddr32(x, y)); | 54 ASSERT_EQ(expected, *bitmap.getAddr32(x, y)); |
55 } | 55 } |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 TEST(Blit, ScrollCanvas) { | 61 TEST(Blit, ScrollCanvas) { |
62 static const int kCanvasWidth = 5; | 62 static const int kCanvasWidth = 5; |
63 static const int kCanvasHeight = 5; | 63 static const int kCanvasHeight = 5; |
64 skia::PlatformCanvas canvas(kCanvasWidth, kCanvasHeight, true); | 64 skia::PlatformCanvas canvas(kCanvasWidth, kCanvasHeight, |
| 65 skia::PlatformDevice::FLAGS_OPAQUE); |
65 uint8 initial_values[kCanvasHeight][kCanvasWidth] = { | 66 uint8 initial_values[kCanvasHeight][kCanvasWidth] = { |
66 { 0x00, 0x01, 0x02, 0x03, 0x04 }, | 67 { 0x00, 0x01, 0x02, 0x03, 0x04 }, |
67 { 0x10, 0x11, 0x12, 0x13, 0x14 }, | 68 { 0x10, 0x11, 0x12, 0x13, 0x14 }, |
68 { 0x20, 0x21, 0x22, 0x23, 0x24 }, | 69 { 0x20, 0x21, 0x22, 0x23, 0x24 }, |
69 { 0x30, 0x31, 0x32, 0x33, 0x34 }, | 70 { 0x30, 0x31, 0x32, 0x33, 0x34 }, |
70 { 0x40, 0x41, 0x42, 0x43, 0x44 }}; | 71 { 0x40, 0x41, 0x42, 0x43, 0x44 }}; |
71 SetToCanvas<5, 5>(&canvas, initial_values); | 72 SetToCanvas<5, 5>(&canvas, initial_values); |
72 | 73 |
73 // Sanity check on input. | 74 // Sanity check on input. |
74 VerifyCanvasValues<5, 5>(&canvas, initial_values); | 75 VerifyCanvasValues<5, 5>(&canvas, initial_values); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 { 0x20, 0x21, 0x22, 0x23, 0x24 }, | 154 { 0x20, 0x21, 0x22, 0x23, 0x24 }, |
154 { 0x30, 0x31, 0x32, 0x33, 0x34 }, | 155 { 0x30, 0x31, 0x32, 0x33, 0x34 }, |
155 { 0x40, 0x41, 0x42, 0x43, 0x44 }}; | 156 { 0x40, 0x41, 0x42, 0x43, 0x44 }}; |
156 SetToCanvas<5, 5>(&canvas, initial_values); | 157 SetToCanvas<5, 5>(&canvas, initial_values); |
157 | 158 |
158 // Sanity check on input. | 159 // Sanity check on input. |
159 VerifyCanvasValues<5, 5>(&canvas, initial_values); | 160 VerifyCanvasValues<5, 5>(&canvas, initial_values); |
160 } | 161 } |
161 | 162 |
162 #endif | 163 #endif |
163 | |
OLD | NEW |