<commit_before>﻿using System;
using System.Runtime.InteropServices;
using Avalonia.OpenGL;
using Avalonia.OpenGL.Angle;
using Avalonia.OpenGL.Egl;
using Avalonia.OpenGL.Surfaces;
using Windows.UI.Composition.Interop;

namespace Avalonia.Win32
{
    internal class CompositionEglGlPlatformSurface : EglGlPlatformSurfaceBase
    {
        private readonly EglDisplay _display;
        private EglPlatformOpenGlInterface _egl;
        private readonly IEglWindowGlPlatformSurfaceInfo _info;
        private ICompositionDrawingSurfaceInterop _surfaceInterop;
        private Windows.UI.Composition.Visual _surface;        

        public CompositionEglGlPlatformSurface(EglPlatformOpenGlInterface egl, IEglWindowGlPlatformSurfaceInfo info) : base()
        {            
            _display = egl.Display;
            _egl = egl;
            _info = info;
        }

        public IBlurHost AttachToCompositionTree(IntPtr hwnd)
        {
            using (_egl.PrimaryContext.MakeCurrent())
            {
                _surfaceInterop = CompositionHost.Instance.InitialiseWindowCompositionTree(hwnd, out _surface, out var blurHost);
                return blurHost;
            }
        }

        public override IGlPlatformSurfaceRenderTarget CreateGlRenderTarget()
        {
            return new CompositionRenderTarget(_egl, _surface, _surfaceInterop, _info);
        }

        class CompositionRenderTarget : EglPlatformSurfaceRenderTargetBase
        {
            private readonly EglPlatformOpenGlInterface _egl;
            private readonly IEglWindowGlPlatformSurfaceInfo _info;
            private PixelSize _currentSize;
            private readonly ICompositionDrawingSurfaceInterop _surfaceInterop;
            private static Guid s_Iid = Guid.Parse("6f15aaf2-d208-4e89-9ab4-489535d34f9c");
            private Windows.UI.Composition.Visual _compositionVisual;

            public CompositionRenderTarget(EglPlatformOpenGlInterface egl,
                Windows.UI.Composition.Visual compositionVisual,<commit_msg>remove unused var.<commit_after>﻿using System;
using System.Runtime.InteropServices;
using Avalonia.OpenGL;
using Avalonia.OpenGL.Angle;
using Avalonia.OpenGL.Egl;
using Avalonia.OpenGL.Surfaces;
using Windows.UI.Composition.Interop;

namespace Avalonia.Win32
{
    internal class CompositionEglGlPlatformSurface : EglGlPlatformSurfaceBase
    {
        private EglPlatformOpenGlInterface _egl;
        private readonly IEglWindowGlPlatformSurfaceInfo _info;
        private ICompositionDrawingSurfaceInterop _surfaceInterop;
        private Windows.UI.Composition.Visual _surface;

        public CompositionEglGlPlatformSurface(EglPlatformOpenGlInterface egl, IEglWindowGlPlatformSurfaceInfo info) : base()
        {
            _egl = egl;
            _info = info;
        }

        public IBlurHost AttachToCompositionTree(IntPtr hwnd)
        {
            using (_egl.PrimaryContext.MakeCurrent())
            {
                _surfaceInterop = CompositionHost.Instance.InitialiseWindowCompositionTree(hwnd, out _surface, out var blurHost);
                return blurHost;
            }
        }

        public override IGlPlatformSurfaceRenderTarget CreateGlRenderTarget()
        {
            return new CompositionRenderTarget(_egl, _surface, _surfaceInterop, _info);
        }

        class CompositionRenderTarget : EglPlatformSurfaceRenderTargetBase
        {
            private readonly EglPlatformOpenGlInterface _egl;
            private readonly IEglWindowGlPlatformSurfaceInfo _info;
            private PixelSize _currentSize;
            private readonly ICompositionDrawingSurfaceInterop _surfaceInterop;
            private static Guid s_Iid = Guid.Parse("6f15aaf2-d208-4e89-9ab4-489535d34f9c");
            private Windows.UI.Composition.Visual _compositionVisual;

            public CompositionRenderTarget(EglPlatformOpenGlInterface egl,
                Windows.UI.Composition.Visual compositionVisual,
{'fraction_non_alphanumeric': 0.05366591080876795, 'fraction_numerical': 0.011589821113630638, 'mean_word_length': 2.88454011741683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '681077', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1034, 'n_words': 205}