Bugzilla – Attachment 241788 Details for
Bug 426370
Checkerboard-like artifacts in Qt/GTK widgets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
Test case exposing the opacity/alpha channel bug
checker-bug.cs (text/plain), 1.74 KB, created by
Aaron Bockover
on 2008-09-25 21:22:27 UTC
(
hide
)
Description:
Test case exposing the opacity/alpha channel bug
Filename:
MIME Type:
Creator:
Aaron Bockover
Created:
2008-09-25 21:22:27 UTC
Size:
1.74 KB
patch
obsolete
>// Compile: gmcs -r:Mono.Cairo -pkg:gtk-sharp-2.0 checker-bug.cs >// Run: mono checker-bug.exe > >using System; >using Gtk; >using Cairo; > >class CheckerBugWindow : Window >{ > static void Main () > { > Application.Init (); > > var win = new CheckerBugWindow { > BorderWidth = 10, > WindowPosition = WindowPosition.Center, > }; > > win.SetDefaultSize (500, 400); > win.DeleteEvent += (o, e) => Application.Quit (); > win.ShowAll (); > > Application.Run (); > } > > public CheckerBugWindow () : base ("Checker Bug Test") > { > var vbox = new VBox { Spacing = 10 }; > var hbox = new HBox { Spacing = 5 }; > var bug = new CheckerBugDrawing (); > var opacity_entry = new SpinButton (0, 1, 0.01) { Value = bug.Opacity }; > > opacity_entry.ValueChanged += (o, e) => bug.Opacity = opacity_entry.Value; > > hbox.PackStart (new Label ("Opacity:"), false, false, 0); > hbox.PackStart (opacity_entry, false, false, 0); > vbox.PackStart (hbox, false, false, 0); > vbox.PackStart (bug, true, true, 0); > > Add (vbox); > } > > class CheckerBugDrawing : DrawingArea > { > double opacity = 1.0; > public double Opacity { > get { return opacity; } > set { opacity = value; QueueDraw (); } > } > > protected override bool OnExposeEvent (Gdk.EventExpose evnt) > { > var cr = Gdk.CairoHelper.Create (GdkWindow); > > // Bug is reproduced here > cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); > cr.Color = new Color (0, 0, 0, Opacity); > cr.Fill (); > > ((IDisposable)cr).Dispose (); > return true; > } > } >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 426370
:
239618
|
241788
|
242324
|
242325