Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Side by Side Diff: content/renderer/skia_benchmarking_extension_unittest.cc

Issue 337163003: Switch to the new SkCanvas::willSave() API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | skia/ext/analysis_canvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | skia/ext/analysis_canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698