OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/renderer/skia_benchmarking_extension.h" | 5 #include "content/renderer/skia_benchmarking_extension.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "third_party/skia/include/core/SkCanvas.h" | 8 #include "third_party/skia/include/core/SkCanvas.h" |
9 #include "third_party/skia/include/core/SkGraphics.h" | 9 #include "third_party/skia/include/core/SkGraphics.h" |
10 #include "third_party/skia/src/utils/debugger/SkDebugCanvas.h" | 10 #include "third_party/skia/src/utils/debugger/SkDebugCanvas.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // Verify the recorded commands. | 60 // Verify the recorded commands. |
61 DrawType cmd; | 61 DrawType cmd; |
62 int idx = 0; | 62 int idx = 0; |
63 ASSERT_EQ(canvas.getSize(), 6); | 63 ASSERT_EQ(canvas.getSize(), 6); |
64 | 64 |
65 ASSERT_TRUE(canvas.getDrawCommandAt(idx) != NULL); | 65 ASSERT_TRUE(canvas.getDrawCommandAt(idx) != NULL); |
66 cmd = canvas.getDrawCommandAt(idx)->getType(); | 66 cmd = canvas.getDrawCommandAt(idx)->getType(); |
67 EXPECT_EQ(cmd, SAVE); | 67 EXPECT_EQ(cmd, SAVE); |
68 EXPECT_STREQ(SkDrawCommand::GetCommandString(cmd), "Save"); | 68 EXPECT_STREQ(SkDrawCommand::GetCommandString(cmd), "Save"); |
69 EXPECT_TRUE(HasInfoField(canvas, idx, "SaveFlags")); | |
70 | 69 |
71 ASSERT_TRUE(canvas.getDrawCommandAt(++idx) != NULL); | 70 ASSERT_TRUE(canvas.getDrawCommandAt(++idx) != NULL); |
72 cmd = canvas.getDrawCommandAt(idx)->getType(); | 71 cmd = canvas.getDrawCommandAt(idx)->getType(); |
73 EXPECT_EQ(cmd, CLIP_RECT); | 72 EXPECT_EQ(cmd, CLIP_RECT); |
74 EXPECT_STREQ(SkDrawCommand::GetCommandString(cmd), "Clip Rect"); | 73 EXPECT_STREQ(SkDrawCommand::GetCommandString(cmd), "Clip Rect"); |
75 EXPECT_TRUE(HasInfoField(canvas, idx, "SkRect")); | 74 EXPECT_TRUE(HasInfoField(canvas, idx, "SkRect")); |
76 EXPECT_TRUE(HasInfoField(canvas, idx, "Op")); | 75 EXPECT_TRUE(HasInfoField(canvas, idx, "Op")); |
77 EXPECT_TRUE(HasInfoField(canvas, idx, "doAA")); | 76 EXPECT_TRUE(HasInfoField(canvas, idx, "doAA")); |
78 | 77 |
79 ASSERT_TRUE(canvas.getDrawCommandAt(++idx) != NULL); | 78 ASSERT_TRUE(canvas.getDrawCommandAt(++idx) != NULL); |
(...skipping 16 matching lines...) Expand all Loading... |
96 EXPECT_STREQ(SkDrawCommand::GetCommandString(cmd), "Draw Rect"); | 95 EXPECT_STREQ(SkDrawCommand::GetCommandString(cmd), "Draw Rect"); |
97 EXPECT_TRUE(HasInfoField(canvas, idx, "SkRect")); | 96 EXPECT_TRUE(HasInfoField(canvas, idx, "SkRect")); |
98 | 97 |
99 ASSERT_TRUE(canvas.getDrawCommandAt(++idx) != NULL); | 98 ASSERT_TRUE(canvas.getDrawCommandAt(++idx) != NULL); |
100 cmd = canvas.getDrawCommandAt(idx)->getType(); | 99 cmd = canvas.getDrawCommandAt(idx)->getType(); |
101 EXPECT_EQ(cmd, RESTORE); | 100 EXPECT_EQ(cmd, RESTORE); |
102 EXPECT_STREQ(SkDrawCommand::GetCommandString(cmd), "Restore"); | 101 EXPECT_STREQ(SkDrawCommand::GetCommandString(cmd), "Restore"); |
103 } | 102 } |
104 | 103 |
105 } // namespace content | 104 } // namespace content |
OLD | NEW |