OSDN Git Service

d2dファクトリーはシングルスレッドでも支障はない&stroke関係のファクトリーを保持しないようにした
authortest <test@yahoo.co.jp>
Sat, 22 Aug 2020 04:38:21 +0000 (13:38 +0900)
committertest <test@yahoo.co.jp>
Sat, 22 Aug 2020 04:38:21 +0000 (13:38 +0900)
Core/Direct2D/D2DRenderCommon.cs

index 78e516c..88f7604 100644 (file)
@@ -96,8 +96,19 @@ namespace FooEditEngine
 
         public D2D.Factory Factory;
 
+        public D2D.StrokeStyle Get(D2D.RenderTarget render,HilightType type)
+        {
+            return this.Get(render.Factory, type);
+        }
+
+        [Obsolete]
         public D2D.StrokeStyle Get(HilightType type)
         {
+            return this.Get(this.Factory, type);
+        }
+
+        public D2D.StrokeStyle Get(D2D.Factory factory,HilightType type)
+        {
             if(this.Factory == null || this.Factory.IsDisposed)
                 throw new InvalidOperationException();
             D2D.StrokeStyle stroke;
@@ -199,9 +210,9 @@ namespace FooEditEngine
         {
             this.DWFactory = new DW.Factory(DW.FactoryType.Shared);
 #if METRO || WINDOWS_UWP
-            this.D2DFactory = new D2D.Factory1(D2D.FactoryType.MultiThreaded);
+            this.D2DFactory = new D2D.Factory1(D2D.FactoryType.SingleThreaded);
 #else
-            this.D2DFactory = new D2D.Factory(D2D.FactoryType.MultiThreaded);
+            this.D2DFactory = new D2D.Factory(D2D.FactoryType.SingleThreaded);
 #endif
             this.Brushes = new ColorBrushCollection();
             this.Strokes = new StrokeCollection();