Esempio n. 1
0
 public override void Flush()
 {
     if (IsChanged)
     {
         FInternalTextureOut.SliceCount = Length;
         FInternalTextureOut.MarkPinAsChanged();
     }
     base.Flush();
 }
Esempio n. 2
0
 public override void Flush(bool force = false)
 {
     if (force || IsChanged)
     {
         FInternalTextureOut.SliceCount = Length;
         FInternalTextureOut.MarkPinAsChanged();
     }
     base.Flush(force);
 }
Esempio n. 3
0
        public void Evaluate(int spreadMax)
        {
            FWebRenderers.ResizeAndDispose(spreadMax, (i) => new HTMLTextureRenderer(FLogger, FFrameRateIn[i]));

            FTextureOut.SliceCount        = spreadMax;
            FRootElementOut.SliceCount    = spreadMax;
            FDomOut.SliceCount            = spreadMax;
            FDocumentWidthOut.SliceCount  = spreadMax;
            FDocumentHeightOut.SliceCount = spreadMax;
            FIsLoadingOut.SliceCount      = spreadMax;
            FLoadedOut.SliceCount         = spreadMax;
            FErrorTextOut.SliceCount      = spreadMax;
            FCurrentUrlOut.SliceCount     = spreadMax;

            for (int i = 0; i < spreadMax; i++)
            {
                var webRenderer = FWebRenderers[i];

                var frameRate = VMath.Clamp(FFrameRateIn[i], HTMLTextureRenderer.MIN_FRAME_RATE, HTMLTextureRenderer.MAX_FRAME_RATE);
                if (frameRate != webRenderer.FrameRate)
                {
                    webRenderer.Dispose();
                    webRenderer      = new HTMLTextureRenderer(FLogger, frameRate);
                    FWebRenderers[i] = webRenderer;
                }

                // Check enabled state
                webRenderer.Enabled = FEnabledIn[i];
                if (!webRenderer.Enabled)
                {
                    continue;
                }

                // LoadUrl or LoadString
                LoadContent(webRenderer, new Size(FWidthIn[i], FHeightIn[i]), i);

                // Assign inputs
                webRenderer.ZoomLevel = FZoomLevelIn[i];
                webRenderer.Mouse     = FMouseIn[i];
                webRenderer.Keyboard  = FKeyboardIn[i];
                webRenderer.ScrollTo  = FScrollToIn[i];

                if (FExecuteIn[i])
                {
                    webRenderer.ExecuteJavaScript(FJavaScriptIn[i]);
                }

                if (FUpdateDomIn[i])
                {
                    webRenderer.UpdateDom();
                }

                if (FReloadIn[i])
                {
                    webRenderer.Reload();
                }

                // Set outputs
                FErrorTextOut[i] = webRenderer.CurrentError;
                FIsLoadingOut[i] = webRenderer.IsLoading;
                FLoadedOut[i]    = webRenderer.Loaded;
                // As long as the renderer is in the loading state stick to the old values
                if (!webRenderer.IsLoading)
                {
                    if (FDomOut[i] != webRenderer.CurrentDom)
                    {
                        FDomOut[i] = webRenderer.CurrentDom;
                    }
                    var rootElement = webRenderer.CurrentDom != null
                        ? webRenderer.CurrentDom.Root
                        : null;
                    if (FRootElementOut[i] != rootElement)
                    {
                        FRootElementOut[i] = rootElement;
                    }
                    var documentSize = webRenderer.DocumentSize;
                    FDocumentWidthOut[i]  = documentSize.Width;
                    FDocumentHeightOut[i] = documentSize.Height;
                    FCurrentUrlOut[i]     = webRenderer.CurrentUrl;
                }
            }

            FTextureOut.MarkPinAsChanged();
        }
Esempio n. 4
0
 protected override void SetResourcePinsChanged()
 {
     FTextureOut.MarkPinAsChanged();
 }