| 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 "gfx/blit.h" | |
| 7 #include "gfx/point.h" | |
| 8 #include "gfx/rect.h" | |
| 9 #include "skia/ext/platform_canvas.h" | 6 #include "skia/ext/platform_canvas.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "ui/gfx/blit.h" |
| 9 #include "ui/gfx/point.h" |
| 10 #include "ui/gfx/rect.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // Fills the given canvas with the values by duplicating the values into each | 14 // Fills the given canvas with the values by duplicating the values into each |
| 15 // color channel for the corresponding pixel. | 15 // color channel for the corresponding pixel. |
| 16 // | 16 // |
| 17 // Example values = {{0x0, 0x01}, {0x12, 0xFF}} would give a canvas with: | 17 // Example values = {{0x0, 0x01}, {0x12, 0xFF}} would give a canvas with: |
| 18 // 0x00000000 0x01010101 | 18 // 0x00000000 0x01010101 |
| 19 // 0x12121212 0xFFFFFFFF | 19 // 0x12121212 0xFFFFFFFF |
| 20 template<int w, int h> | 20 template<int w, int h> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 SetToCanvas<5, 5>(&canvas, initial_values); | 126 SetToCanvas<5, 5>(&canvas, initial_values); |
| 127 gfx::ScrollCanvas(&canvas, center_three, gfx::Point(2, 2)); | 127 gfx::ScrollCanvas(&canvas, center_three, gfx::Point(2, 2)); |
| 128 uint8 scroll_diagonal_expected[kCanvasHeight][kCanvasWidth] = { | 128 uint8 scroll_diagonal_expected[kCanvasHeight][kCanvasWidth] = { |
| 129 { 0x00, 0x01, 0x02, 0x03, 0x04 }, | 129 { 0x00, 0x01, 0x02, 0x03, 0x04 }, |
| 130 { 0x10, 0x11, 0x12, 0x13, 0x14 }, | 130 { 0x10, 0x11, 0x12, 0x13, 0x14 }, |
| 131 { 0x20, 0x21, 0x22, 0x23, 0x24 }, | 131 { 0x20, 0x21, 0x22, 0x23, 0x24 }, |
| 132 { 0x30, 0x31, 0x32, 0x11, 0x34 }, | 132 { 0x30, 0x31, 0x32, 0x11, 0x34 }, |
| 133 { 0x40, 0x41, 0x42, 0x43, 0x44 }}; | 133 { 0x40, 0x41, 0x42, 0x43, 0x44 }}; |
| 134 VerifyCanvasValues<5, 5>(&canvas, scroll_diagonal_expected); | 134 VerifyCanvasValues<5, 5>(&canvas, scroll_diagonal_expected); |
| 135 } | 135 } |
| OLD | NEW |