OSDN Git Service

デットロックが起きる可能性があるので安全な形に書き直した
[fooeditengine/FooEditEngine.git] / Metro / FooEditEngine / Direct2D / D2DRender.cs
index f8003b6..adcd0d7 100644 (file)
@@ -133,7 +133,7 @@ namespace FooEditEngine
             return this.Size.Height != 0 && this.Size.Width != 0;
         }
 
-        public override void BegineDraw()
+        public void DrawContent(EditView view,bool IsEnabled,Rectangle updateRect)
         {
             SharpDX.Point offset;
             this.Surface = this.SurfaceImageNative.BeginDraw(
@@ -144,12 +144,14 @@ namespace FooEditEngine
                     dpix, dpiy, D2D.BitmapOptions.Target | D2D.BitmapOptions.CannotDraw);
             this.Bitmap = new D2D.Bitmap1(this.D2DContext, this.Surface, prop);
             this.D2DContext.Target = this.Bitmap;
-            this.D2DContext.Transform = Matrix3x2.Translation(offset.X,offset.Y);
+            this.D2DContext.Transform = Matrix3x2.Translation(offset.X, offset.Y);
             base.BegineDraw();
-        }
 
-        public override void EndDraw()
-        {
+            if (IsEnabled)
+                view.Draw(updateRect);
+            else
+                this.FillBackground(updateRect);
+
             base.EndDraw();
             this.Surface.Dispose();
             this.Bitmap.Dispose();