瀏覽代碼

Allow to use GPU with deferred renderer

Nikita Tsukanov 7 年之前
父節點
當前提交
cba5337d20
共有 1 個文件被更改,包括 3 次插入8 次删除
  1. 3 8
      src/Avalonia.Native/WindowImplBase.cs

+ 3 - 8
src/Avalonia.Native/WindowImplBase.cs

@@ -36,13 +36,8 @@ namespace Avalonia.Native
         {
             var opts = AvaloniaLocator.Current.GetService<AvaloniaNativeOptions>();
 
-            // GPU is currently not compatible with DeferredRenderer
-            if (opts.UseGpu)
-            {
-                _gpu = true;
-            }
-            else
-                _deferredRendering = opts.UseDeferredRendering;
+            _gpu = opts.UseGpu;
+            _deferredRendering = opts.UseDeferredRendering;
 
             _keyboard = AvaloniaLocator.Current.GetService<IKeyboardDevice>();
             _mouse = AvaloniaLocator.Current.GetService<IMouseDevice>();
@@ -194,7 +189,7 @@ namespace Avalonia.Native
 
             void IAvnWindowBaseEvents.RunRenderPriorityJobs()
             {
-                if (_parent._deferredRendering 
+                if (_parent._deferredRendering && !_parent._gpu
                     && _parent._lastRenderedLogicalSize != _parent.ClientSize)
                     // Hack to trigger Paint event on the renderer
                     _parent.Paint?.Invoke(new Rect());