Exemplo n.º 1
0
        public static void InitializeWorkbench()
        {
            workbench = new DefaultWorkbench();
            MessageService.MainForm = workbench;

            caller = new STAThreadCaller(workbench);

            workbench.InitializeWorkspace();

            workbench.WorkbenchLayout = new SdiWorkbenchLayout();

            //display mapview
            IViewContent browserPane = new MapViewPane();

            browserPane.TitleName = "view1";
            if (browserPane != null)
            {
                WorkbenchSingleton.Workbench.ShowView(browserPane);
            }
            //link layertree and mapview
            foreach (PadDescriptor item in workbench.PadContentCollection)
            {
                LayerTree tree = item.PadContent as LayerTree;
                if (tree != null)
                {
                    DotSpatial.Controls.Legend legend = tree.Control as DotSpatial.Controls.Legend;

                    ((browserPane as MapViewPane).Control as MapView).MapControl.Legend = legend;
                    break;
                }
            }
        }
Exemplo n.º 2
0
        bool _drawToSurface(LayerTree layerTree)
        {
            D.assert(this._surface != null);

            var frame = this._surface.acquireFrame(
                layerTree.frameSize, layerTree.devicePixelRatio, layerTree.antiAliasing);

            if (frame == null)
            {
                return(false);
            }

            var canvas = frame.getCanvas();

            using (var compositorFrame = this._compositorContext.acquireFrame(canvas, true)) {
                if (compositorFrame != null && compositorFrame.raster(layerTree, false))
                {
                    frame.submit();
                    this._fireNextFrameCallbackIfPresent();
                    return(true);
                }

                return(false);
            }
        }
Exemplo n.º 3
0
 public void Complete(LayerTree resource)
 {
     if (continuation_ != null)
     {
         continuation_(resource, trace_id_);
         continuation_ = null;
         //TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_);
         //TRACE_FLOW_STEP("flutter", "PipelineItem", trace_id_);
     }
 }
Exemplo n.º 4
0
        public void Render(LayerTree layer_tree)
        {
            if (layer_tree == null)
            {
                return;
            }

            SKSizeI frame_size = new SKSizeI((int)_physicalWidth,
                                             (int)_physicalHeight);

            if (frame_size.IsEmpty)
            {
                return;
            }

            layer_tree.set_frame_size(frame_size);

            // ** Start Hack
            // I just wanted it outputted at this time, rather than frame dependant

            // var picture = layer_tree.Flatten(new SKRect(0, 0, frame_size.Width, frame_size.Height));
            var picture = ((PictureLayer)((ContainerLayer)layer_tree.root_layer_).layers_[0]).picture();

            //// get the screen density for scaling

            //var scale = _scale;
            //var scaledSize = new SKSize(frame_size.Width / scale, frame_size.Height / scale);

            ////// handle the device screen density
            //_canvas.Scale(_scale);

            //// make sure the canvas is blank
            //_canvas.Clear(SKColors.White);

            //// draw some text
            //var paint = new SKPaint
            //{
            //    Color = SKColors.Black,
            //    IsAntialias = true,
            //    Style = SKPaintStyle.Fill,
            //    TextAlign = SKTextAlign.Center,
            //    TextSize = 24
            //};
            //var coord = new SKPoint(scaledSize.Width / 2, (scaledSize.Height + paint.TextSize) / 2);
            //_canvas.DrawText("Xamarin.Flutter", coord, paint);
            _canvas.DrawPicture(picture);

            //_canvas.DrawText("Hello", scaledSize.Width / 2, (scaledSize.Height + paint.TextSize) / 2, paint);

            // ** End Hack

            // This is where we are meant to go
            //animator_.Render(layer_tree);
        }
Exemplo n.º 5
0
        void _doDraw(LayerTree layerTree)
        {
            if (layerTree == null || this._surface == null)
            {
                return;
            }

            if (this._drawToSurface(layerTree))
            {
                this._lastLayerTree = layerTree;
            }
        }
Exemplo n.º 6
0
 public NativeScene(Layer rootLayer,
                    uint rasterizerTracingThreshold,
                    bool checkerboardRasterCacheImages,
                    bool checkerboardOffscreenLayers)
 {
     m_layerTree = new LayerTree();
     m_layerTree.set_root_layer(rootLayer);
     m_layerTree.set_rasterizer_tracing_threshold(rasterizerTracingThreshold);
     m_layerTree.set_checkerboard_raster_cache_images(
         checkerboardRasterCacheImages);
     m_layerTree.set_checkerboard_offscreen_layers(checkerboardOffscreenLayers);
 }
Exemplo n.º 7
0
        public void Render(LayerTree layer_tree)
        {
            if (dimension_change_pending_ &&
                layer_tree.frame_size() != last_layer_tree_size_)
            {
                dimension_change_pending_ = false;
            }
            last_layer_tree_size_ = layer_tree.frame_size();

            //if (layer_tree != null)
            //{
            //    // Note the frame time for instrumentation.
            //    layer_tree.set_construction_time(fml::TimePoint::Now() -
            //                                      last_begin_frame_time_);
            //}

            // Commit the pending continuation.
            //producer_continuation_.Complete(layer_tree);

            //delegate_.OnAnimatorDraw(layer_tree_pipeline_);
        }
Exemplo n.º 8
0
        public void Render(LayerTree layer_tree)
        {
            if (layer_tree == null)
            {
                return;
            }

            SKSizeI frame_size = new SKSizeI((int)_physicalWidth,
                                             (int)_physicalHeight);

            if (frame_size.IsEmpty)
            {
                return;
            }

            layer_tree.set_frame_size(frame_size);

            var picture = layer_tree.Flatten(new SKRect(0, 0, frame_size.Width, frame_size.Height));

            _canvas.DrawPicture(picture);
        }
Exemplo n.º 9
0
 public void draw(LayerTree layerTree)
 {
     this._doDraw(layerTree);
 }
Exemplo n.º 10
0
 public void teardown()
 {
     this._compositorContext.onGrContextDestroyed();
     this._surface       = null;
     this._lastLayerTree = null;
 }
Exemplo n.º 11
0
 public virtual bool Raster(LayerTree layer_tree, bool ignore_raster_cache)
 {
     layer_tree.Preroll(this, ignore_raster_cache);
     layer_tree.Paint(this, ignore_raster_cache);
     return(true);
 }