dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0400-grub-core-commands-videotest.c-Reduce-flickering-and.patch

f96e0b
From 3cc0a7193fb4eb6fcfb9698b6a84c5df57349ab8 Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Thu, 2 May 2013 14:34:13 +0200
f96e0b
Subject: [PATCH 400/482] 	* grub-core/commands/videotest.c: Reduce
f96e0b
 flickering and draw 6 squares 	instead of 2 to have full RGB/CMY test
f96e0b
 pattern.
f96e0b
f96e0b
---
f96e0b
 ChangeLog                      |  5 +++++
f96e0b
 grub-core/commands/videotest.c | 43 ++++++++++++++++++++++++++----------------
f96e0b
 2 files changed, 32 insertions(+), 16 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 642858c..b202abe 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,3 +1,8 @@
f96e0b
+2013-05-02  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
+
f96e0b
+	* grub-core/commands/videotest.c: Reduce flickering and draw 6 squares
f96e0b
+	instead of 2 to have full RGB/CMY test pattern.
f96e0b
+
f96e0b
 2013-04-30  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
 	Add few more tests.
f96e0b
diff --git a/grub-core/commands/videotest.c b/grub-core/commands/videotest.c
f96e0b
index 2256237..b6c181b 100644
f96e0b
--- a/grub-core/commands/videotest.c
f96e0b
+++ b/grub-core/commands/videotest.c
f96e0b
@@ -49,7 +49,6 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
f96e0b
   if (grub_strcmp (cmd->name, "vbetest") == 0)
f96e0b
     grub_dl_load ("vbe");
f96e0b
 #endif
f96e0b
-
f96e0b
   mode = grub_env_get ("gfxmode");
f96e0b
   if (argc)
f96e0b
     mode = args[0];
f96e0b
@@ -155,26 +154,38 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
f96e0b
 
f96e0b
   grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
f96e0b
 
f96e0b
-  for (i = 0; i < 2; i++)
f96e0b
+  for (i = 0; i < 5; i++)
f96e0b
     {
f96e0b
-      color = grub_video_map_rgb (0, 0, 0);
f96e0b
-      grub_video_fill_rect (color, 0, 0, width, height);
f96e0b
 
f96e0b
-      color = grub_video_map_rgb (255, 0, 0);
f96e0b
-      grub_video_fill_rect (color, 0, 0, 100, 100);
f96e0b
+      if (i == 0 || i == 1)
f96e0b
+	{	  
f96e0b
+	  color = grub_video_map_rgb (0, 0, 0);
f96e0b
+	  grub_video_fill_rect (color, 0, 0, width, height);
f96e0b
 
f96e0b
-      color = grub_video_map_rgb (0, 255, 255);
f96e0b
-      grub_video_fill_rect (color, 100, 100, 100, 100);
f96e0b
+	  color = grub_video_map_rgb (255, 0, 0);
f96e0b
+	  grub_video_fill_rect (color, 0, 0, 100, 100);
f96e0b
 
f96e0b
-      grub_video_set_viewport (x + 150, y + 150,
f96e0b
-			       width - 150 * 2, height - 150 * 2);
f96e0b
-      color = grub_video_map_rgb (77, 33, 77);
f96e0b
-      grub_video_fill_rect (color, 0, 0, width, height);
f96e0b
-      grub_video_swap_buffers ();
f96e0b
-    }
f96e0b
+	  color = grub_video_map_rgb (0, 255, 0);
f96e0b
+	  grub_video_fill_rect (color, 100, 0, 100, 100);
f96e0b
+
f96e0b
+	  color = grub_video_map_rgb (0, 0, 255);
f96e0b
+	  grub_video_fill_rect (color, 200, 0, 100, 100);
f96e0b
+
f96e0b
+	  color = grub_video_map_rgb (0, 255, 255);
f96e0b
+	  grub_video_fill_rect (color, 0, 100, 100, 100);
f96e0b
+
f96e0b
+	  color = grub_video_map_rgb (255, 0, 255);
f96e0b
+	  grub_video_fill_rect (color, 100, 100, 100, 100);
f96e0b
+
f96e0b
+	  color = grub_video_map_rgb (255, 255, 0);
f96e0b
+	  grub_video_fill_rect (color, 200, 100, 100, 100);
f96e0b
+
f96e0b
+	  grub_video_set_viewport (x + 150, y + 150,
f96e0b
+				   width - 150 * 2, height - 150 * 2);
f96e0b
+	  color = grub_video_map_rgb (77, 33, 77);
f96e0b
+	  grub_video_fill_rect (color, 0, 0, width, height);
f96e0b
+	}
f96e0b
 
f96e0b
-  for (i = 0; i < 5; i++)
f96e0b
-    {
f96e0b
       color = grub_video_map_rgb (i, 33, 77);
f96e0b
       grub_video_fill_rect (color, 0, 0, width, height);
f96e0b
       grub_video_blit_render_target (text_layer, GRUB_VIDEO_BLIT_BLEND, 0, 0,
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b