We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e7fe63f + 3656b55 commit 8ea4837Copy full SHA for 8ea4837
uefi-test-runner/examples/sierpinski.rs
@@ -55,6 +55,23 @@ impl Buffer {
55
dims: (self.width, self.height),
56
})
57
}
58
+
59
+ /// Update only a pixel to the framebuffer.
60
+ fn blit_pixel(
61
+ &self,
62
+ gop: &mut GraphicsOutput,
63
+ coords: (usize, usize),
64
+ ) -> Result {
65
+ gop.blt(BltOp::BufferToVideo {
66
+ buffer: &self.pixels,
67
+ src: BltRegion::SubRectangle {
68
+ coords,
69
+ px_stride: self.width,
70
+ },
71
+ dest: coords,
72
+ dims: (1, 1),
73
+ })
74
+ }
75
76
// ANCHOR_END: buffer
77
@@ -90,6 +107,9 @@ fn draw_sierpinski(bt: &BootServices) -> Result {
90
107
91
108
92
109
110
+ // Draw background.
111
+ buffer.blit(&mut gop)?;
112
93
113
let size = Point::new(width as f32, height as f32);
94
114
95
115
// Define the vertices of a big triangle.
@@ -119,7 +139,7 @@ fn draw_sierpinski(bt: &BootServices) -> Result {
119
139
pixel.blue = 0;
120
140
121
141
// Draw the buffer to the screen.
122
- buffer.blit(&mut gop)?;
142
+ buffer.blit_pixel(&mut gop,(p.xasusize, p.yasusize))?;
123
143
124
144
125
145
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments