Skip to content

Commit bf7c84f

Browse files
authored
Merge branch 'master' into master
2 parents 9e0c07b + 9368c24 commit bf7c84f

7 files changed

Lines changed: 286 additions & 330 deletions

File tree

Tests/Kernels/GraphicTest/Kernel.cs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -49,55 +49,55 @@ private void DoTest(Canvas aCanvas)
4949
aCanvas.Clear(Color.Blue);
5050

5151
/* A red Point */
52-
Pen pen = new Pen(Color.Red);
53-
aCanvas.DrawPoint(pen, 69, 69);
52+
var color = Color.Red;
53+
aCanvas.DrawPoint(color, 69, 69);
5454

55-
Color color = aCanvas.GetPointColor(69, 69);
56-
Assert.AreEqual(color.ToArgb(), Color.Red.ToArgb(), "GetPointColor returns correct value");
55+
Color fetchedColor = aCanvas.GetPointColor(69, 69);
56+
Assert.AreEqual(fetchedColor.ToArgb(), Color.Red.ToArgb(), "GetPointColor returns correct value");
5757

5858
/* A GreenYellow horizontal line */
59-
pen.Color = Color.GreenYellow;
60-
aCanvas.DrawLine(pen, 250, 100, 400, 100);
59+
color = Color.GreenYellow;
60+
aCanvas.DrawLine(color, 250, 100, 400, 100);
6161

6262
/* A Black Lines larger than the canvas */
63-
pen.Color = Color.Black;
64-
aCanvas.DrawLine(pen, -20, 100, aCanvas.Mode.Columns + 20, 100);
65-
aCanvas.DrawLine(pen, -20, -20, aCanvas.Mode.Columns + 20, aCanvas.Mode.Rows + 20);
63+
color = Color.Black;
64+
aCanvas.DrawLine(color, -20, 100, aCanvas.Mode.Columns + 20, 100);
65+
aCanvas.DrawLine(color, -20, -20, aCanvas.Mode.Columns + 20, aCanvas.Mode.Rows + 20);
6666

6767
/* An IndianRed vertical line */
68-
pen.Color = Color.IndianRed;
69-
aCanvas.DrawLine(pen, 350, 150, 350, 250);
68+
color = Color.IndianRed;
69+
aCanvas.DrawLine(color, 350, 150, 350, 250);
7070

7171
/* A MintCream diagonal line */
72-
pen.Color = Color.MintCream;
73-
aCanvas.DrawLine(pen, 250, 150, 400, 250);
72+
color = Color.MintCream;
73+
aCanvas.DrawLine(color, 250, 150, 400, 250);
7474

7575
/* Rectangles of various colors */
76-
pen.Color = Color.PaleVioletRed;
77-
aCanvas.DrawRectangle(pen, 350, 350, 80, 60);
76+
color = Color.PaleVioletRed;
77+
aCanvas.DrawRectangle(color, 350, 350, 80, 60);
7878

79-
pen.Color = Color.Chartreuse;
80-
aCanvas.DrawCircle(pen, 69, 69, 10);
79+
color = Color.Chartreuse;
80+
aCanvas.DrawCircle(color, 69, 69, 10);
8181

82-
pen.Color = Color.CadetBlue;
83-
aCanvas.DrawArc(45, 45, 35, 35, pen, 90, 270);
82+
color = Color.CadetBlue;
83+
aCanvas.DrawArc(45, 45, 35, 35, color, 90, 270);
8484

85-
pen.Color = Color.DimGray;
86-
aCanvas.DrawEllipse(pen, 100, 69, 10, 50);
85+
color = Color.DimGray;
86+
aCanvas.DrawEllipse(color, 100, 69, 10, 50);
8787

88-
pen.Color = Color.MediumPurple;
89-
aCanvas.DrawPolygon(pen, new Point(200, 250), new Point(250, 300), new Point(220, 350), new Point(210, 275));
88+
color = Color.MediumPurple;
89+
aCanvas.DrawPolygon(color, new Point(200, 250), new Point(250, 300), new Point(220, 350), new Point(210, 275));
9090

9191
/* Color.FromName */
9292
aCanvas.Clear(Color.FromName("Navy"));
93-
93+
9494
/* A LimeGreen rectangle */
95-
pen.Color = Color.LimeGreen;
96-
aCanvas.DrawRectangle(pen, 450, 300, 80, 60);
95+
color = Color.LimeGreen;
96+
aCanvas.DrawRectangle(color, 450, 300, 80, 60);
9797

9898
/* A filled rectange */
99-
pen.Color = Color.Chocolate;
100-
aCanvas.DrawFilledRectangle(pen, 200, 150, 400, 300);
99+
color = Color.Chocolate;
100+
aCanvas.DrawFilledRectangle(color, 200, 150, 400, 300);
101101

102102
/* A Bitmap image */
103103
aCanvas.DrawImage(bitmap, new Point(10, 10));
@@ -131,20 +131,20 @@ private void DoTest(Canvas aCanvas)
131131
aCanvas.DrawImageAlpha(bitmap3, new Point(0, 300));
132132

133133
/* Drawing ellipses */
134-
aCanvas.DrawEllipse(pen, 100, 69, 10, 50);
135-
aCanvas.DrawEllipse(pen, 100, 69, 10, 50);
136-
aCanvas.DrawEllipse(pen, 100, 69, 10, 50);
134+
aCanvas.DrawEllipse(color, 100, 69, 10, 50);
135+
aCanvas.DrawEllipse(color, 100, 69, 10, 50);
136+
aCanvas.DrawEllipse(color, 100, 69, 10, 50);
137137

138138
/* Create a PC Screen Font */
139-
pen = new Pen(Color.White);
139+
color = Color.White;
140140
Font font = PCScreenFont.Default;
141141

142142
/* Draw text */
143-
aCanvas.DrawString("Hello Cosmos World!", font, pen, 0, 16 * 5);
144-
aCanvas.DrawString("font data test=" + font.Width + "x" + font.Height, font, pen, 0, 16 * 6);
143+
aCanvas.DrawString("Hello Cosmos World!", font, color, 0, 16 * 5);
144+
aCanvas.DrawString("font data test=" + font.Width + "x" + font.Height, font, color, 0, 16 * 6);
145145

146146
/* Draw char */
147-
aCanvas.DrawChar('A', font, pen, 0, 16 * 7);
147+
aCanvas.DrawChar('A', font, color, 0, 16 * 7);
148148

149149
aCanvas.Display();
150150

@@ -215,7 +215,7 @@ private void DoTest(VGACanvas vGACanvas)
215215
}
216216
}
217217

218-
vGACanvas.DrawLine(new Pen(Color.Red), 10, 10, 10, 50);
218+
vGACanvas.DrawLine(Color.Red, 10, 10, 10, 50);
219219

220220
vGACanvas.Disable();
221221
for (int i = 0; i < 10; i++)

source/Cosmos.Core/CPU.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ public static long EstimateCPUSpeedFromName(string s)
272272
}
273273

274274
/// <summary>
275-
/// Get CPU cycle speed.
275+
/// Get CPU branding name.
276276
/// </summary>
277-
/// <returns>long value.</returns>
277+
/// <returns>CPU's full name</returns>
278278
/// <exception cref="NotImplementedException">Thrown on fatal error, contact support.</exception>
279279
/// <exception cref="NotSupportedException">Thrown if can not read CPU ID.</exception>
280280
public static string GetCPUBrandString()

0 commit comments

Comments
 (0)