diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-06-14 02:12:30 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-06-14 02:12:30 +0200 |
| commit | 26cb42fbd4e0d96237bd3bc0fcf7ebd83b6e0dcc (patch) | |
| tree | 3b3faeea60a142bead56b3db3735838dec0a3c2a | |
| parent | 8d385b053423c16e18d02467bdd54be17c3b42aa (diff) | |
debugTestDRM
| -rw-r--r-- | Crow.csproj | 1 | ||||
| -rw-r--r-- | Crow.dll.config | 2 | ||||
| -rw-r--r-- | src/GraphicObjects/TestWidget.cs | 58 | ||||
| -rw-r--r-- | testDrm/Main.cs | 8 | ||||
| -rw-r--r-- | testDrm/src/Application.cs | 12 | ||||
| -rw-r--r-- | testDrm/src/Linux/DRIControler.cs | 2 | ||||
| -rw-r--r-- | testDrm/test.style | 1 | ||||
| -rw-r--r-- | testDrm/testDrm.csproj | 4 | ||||
| -rwxr-xr-x | testDrm/ui/go.crow | 4 | ||||
| -rwxr-xr-x | testDrm/ui/menu.crow | 1 | ||||
| -rwxr-xr-x | testDrm/ui/perfMeasures.crow | 3 |
11 files changed, 81 insertions, 15 deletions
diff --git a/Crow.csproj b/Crow.csproj index 1c419008..d556c32a 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -213,6 +213,7 @@ <Compile Include="src\Mono.Cairo\EGLDevice.cs" /> <Compile Include="src\Mono.Cairo\DRMDevice.cs" /> <Compile Include="src\Mono.Cairo\DRMSurface.cs" /> + <Compile Include="src\GraphicObjects\TestWidget.cs" /> </ItemGroup> <ItemGroup> <Reference Include="System" /> diff --git a/Crow.dll.config b/Crow.dll.config index ef7562ac..52997305 100644 --- a/Crow.dll.config +++ b/Crow.dll.config @@ -6,7 +6,7 @@ <dllmap os="!windows,osx" dll="libgdk-3-0.dll" target="libgdk-3.so.0"/> <dllmap os="!windows,osx" dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0.so.0"/> <dllmap os="!windows,osx" dll="rsvg-2" target="librsvg-2.so.2"/> - + <dllmap os="!windows,osx" dll="libinput" target="/usr/lib/x86_64-linux-gnu/libinput.so.10"/> <dllmap os="windows" dll="rsvg-2" target="librsvg-2-2.dll"/> diff --git a/src/GraphicObjects/TestWidget.cs b/src/GraphicObjects/TestWidget.cs new file mode 100644 index 00000000..b4880f00 --- /dev/null +++ b/src/GraphicObjects/TestWidget.cs @@ -0,0 +1,58 @@ +// +// TestWidget.cs +// +// Author: +// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Crow +{ + public class TestWidget : GraphicObject + { + double angle = 0.0; + + public TestWidget ():base() + { + } + + protected override void onDraw (Cairo.Context gr) + { + Rectangle r = ClientRectangle; + + double radius = Math.Min (r.Width / 2, r.Height / 2) - 5; + + gr.SetSourceRGBA (1.0, 0, 0, 1.0); + gr.LineWidth = 10; + gr.Arc (r.Width / 2, r.Height / 2, radius, angle, angle +0.5); + gr.Stroke (); + + if (angle > 2.0 * Math.PI) + angle = 0.0; + else + angle += 0.08; + + RegisterForGraphicUpdate (); + } + } +} + diff --git a/testDrm/Main.cs b/testDrm/Main.cs index 45a95d63..81216d34 100644 --- a/testDrm/Main.cs +++ b/testDrm/Main.cs @@ -55,8 +55,9 @@ namespace testDrm System.Threading.Thread.CurrentThread.Name = "Main"; try { - using (TestApp crowApp = new TestApp ()) + using (TestApp crowApp = new TestApp ()){ crowApp.Run (); + } } catch (Exception ex) { Console.WriteLine (ex.ToString ()); } @@ -73,7 +74,7 @@ namespace testDrm #endregion - public Command CMDViewPerf, CMDViewCfg, CMDViewTest0, CMDOpen; + public Command CMDViewPerf, CMDViewCfg, CMDViewTest0, CMDViewGO, CMDOpen; public TestApp () : base () { CrowInterface.KeyboardKeyDown += CrowInterface_KeyboardKeyDown; @@ -81,12 +82,13 @@ namespace testDrm CMDViewPerf = new Command(new Action(() => Load ("#testDrm.ui.perfMeasures.crow").DataSource = this)) { Caption = "Performances"}; CMDViewCfg = new Command(new Action(() => Load ("#testDrm.ui.2.crow").DataSource = this)) { Caption = "Configuration"}; CMDViewTest0 = new Command(new Action(() => Load ("#testDrm.ui.0.crow").DataSource = this)) { Caption = "Test view 0"}; + CMDViewGO = new Command(new Action(() => Load ("#testDrm.ui.go.crow").DataSource = this)) { Caption = "graphic test"}; CMDOpen = new Command(new Action(() => { lock (CrowInterface.UpdateMutex) CrowInterface.AddWidget(new FileDialog());})) { Caption = "Open"}; Load ("#testDrm.ui.menu.crow").DataSource = this; - initTests (); + //initTests (); } void CrowInterface_KeyboardKeyDown (object sender, KeyboardKeyEventArgs e) diff --git a/testDrm/src/Application.cs b/testDrm/src/Application.cs index 7efc0906..30a9573f 100644 --- a/testDrm/src/Application.cs +++ b/testDrm/src/Application.cs @@ -101,7 +101,7 @@ namespace Crow Console.WriteLine (ex.ToString ()); } } - + gpu = new DRIControler(); initCrow (); @@ -591,11 +591,11 @@ namespace Crow gpu = null; using (VTControler master = new VTControler ()) { - // try { - // master.KDMode = VT.KDMode.TEXT; - // } catch (Exception ex) { - // Console.WriteLine (ex.ToString ()); - // } + try { + master.KDMode = KDMode.TEXT; + } catch (Exception ex) { + Console.WriteLine (ex.ToString ()); + } master.SwitchTo (previousVT); } diff --git a/testDrm/src/Linux/DRIControler.cs b/testDrm/src/Linux/DRIControler.cs index cb2794f2..3d5f3009 100644 --- a/testDrm/src/Linux/DRIControler.cs +++ b/testDrm/src/Linux/DRIControler.cs @@ -231,7 +231,7 @@ namespace Linux.DRI { //setScanOutRegion(); //Thread.Sleep (100); - initPageFlipUpdate (); + //initPageFlipUpdate (); return true; } diff --git a/testDrm/test.style b/testDrm/test.style index 0db7f47d..7e06174b 100644 --- a/testDrm/test.style +++ b/testDrm/test.style @@ -14,4 +14,5 @@ FpsDisp { } Window { Template = #Crow.ToolWindow.template; + Background = DimGray; } diff --git a/testDrm/testDrm.csproj b/testDrm/testDrm.csproj index 27db51e6..2cf19157 100644 --- a/testDrm/testDrm.csproj +++ b/testDrm/testDrm.csproj @@ -19,13 +19,13 @@ <Command type="Execute" command="${TargetName}" workingdir="${SolutionDir}/build/${ProjectConfigName}" /> </CustomCommands> </CustomCommands> - <StartupObject>testDrm.TestCrow</StartupObject> + <StartupObject>testDrm.TestApp</StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> - <DefineConstants>DEBUG;</DefineConstants> + <DefineConstants>DEBUG;MEASURE_TIME</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> diff --git a/testDrm/ui/go.crow b/testDrm/ui/go.crow index c3eda9cc..572e2cca 100755 --- a/testDrm/ui/go.crow +++ b/testDrm/ui/go.crow @@ -1,2 +1,4 @@ <?xml version="1.0"?> -<GraphicObject Width="200" Height="200" Background="Mantis"/>
\ No newline at end of file +<Window Width="300" Height="300" Background="Transparent"> + <TestWidget Width="200" Height="200" Background="Mantis"/> +</Window>
\ No newline at end of file diff --git a/testDrm/ui/menu.crow b/testDrm/ui/menu.crow index abe22fbc..df760fae 100755 --- a/testDrm/ui/menu.crow +++ b/testDrm/ui/menu.crow @@ -10,6 +10,7 @@ <MenuItem Command="{CMDViewPerf}"/> <MenuItem Command="{CMDViewCfg}"/> <MenuItem Command="{CMDViewTest0}"/> + <MenuItem Command="{CMDViewGO}"/> </MenuItem> <MenuItem Caption="Edit" Name="edit" Width="Fit"> <MenuItem Caption="Cut"/> diff --git a/testDrm/ui/perfMeasures.crow b/testDrm/ui/perfMeasures.crow index efeac653..5584a6b7 100755 --- a/testDrm/ui/perfMeasures.crow +++ b/testDrm/ui/perfMeasures.crow @@ -1,4 +1,5 @@ <?xml version="1.0"?> -<Window AlwaysOnTop="true" Focusable="true" Caption="Measures" Width="200" Height="360" MinimumSize="100,100" Background="0.2,0.2,0.2,0.2" CornerRadius="10"> +<Window AlwaysOnTop="true" Focusable="true" Caption="Measures" Width="200" Height="360" MinimumSize="100,100" + Background="0.2,0.2,0.2,0.7" CornerRadius="10"> <ListBox Data="{PerfMeasures}" Fit="true" ItemTemplate="#ui.perfMsr.crow" Background="Transparent"/> </Window> |