OSDN Git Service

ブラシをキャッシュするかしないか選択できるようにした
authortest <test@yahoo.co.jp>
Sun, 23 Aug 2020 12:16:10 +0000 (21:16 +0900)
committertest <test@yahoo.co.jp>
Sun, 23 Aug 2020 12:16:10 +0000 (21:16 +0900)
Core/Direct2D/D2DRenderCommon.cs

index 97f3e24..0cb0117 100644 (file)
@@ -8,6 +8,9 @@
 
 You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
+
+#define CACHE_COLOR_BURSH
+
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -55,12 +58,17 @@ namespace FooEditEngine
         public D2D.SolidColorBrush Get(D2D.RenderTarget render,Color4 key)
         {
             D2D.SolidColorBrush brush;
+
+#if CACHE_COLOR_BURSH
             bool result = cache.TryGetValue(key, out brush);
             if (!result)
             {
                 brush = new D2D.SolidColorBrush(render, key);
                 cache.Add(key, brush);
             }
+#else
+            brush = new D2D.SolidColorBrush(render, key);
+#endif
             
             return brush;
         }
@@ -172,7 +180,6 @@ namespace FooEditEngine
             }
         }
 #endif
-
     }
 
     class D2DRenderCommon : IDisposable