<commit_before>﻿// Copyright (c) 2012, <NAME>
// All rights reserved.
// 
// See LICENSE for more information.

using System;
using System.Diagnostics.Contracts;
using System.Threading;

using Frost.Painting;
using Frost.Surfacing;

using SharpDX;
using SharpDX.DXGI;
using SharpDX.Direct2D1;
using SharpDX.Direct3D10;

using DXGIResource = SharpDX.DXGI.Resource;
using Device = SharpDX.Direct3D10.Device;
using DxStop = SharpDX.Direct2D1.GradientStop;
using Factory = SharpDX.Direct2D1.Factory;
using Resource = SharpDX.Direct3D10.Resource;

namespace Frost.DirectX.Common
{
	public class Surface2D : ISurface2D, IEquatable<Surface2D>
	{
		//TODO: add configuration option for surface 2d cache limit?
		public const int CacheLimit = 5;

		private static long _AvailableUniqueId;

		private readonly Device2D _Device2D;
		private readonly Device _Device3D;

		private readonly CacheDictionary<Gradient, LinearGradientBrush>
			_LinearGradientBrushes;

		private readonly CacheDictionary<Gradient, RadialGradientBrush>
			_RadialGradientBrushes;<commit_msg>disposable<commit_after>﻿// Copyright (c) 2012, <NAME>
// All rights reserved.
// 
// See LICENSE for more information.

using System;
using System.Diagnostics.Contracts;
using System.Threading;

using Frost.Painting;
using Frost.Surfacing;

using SharpDX;
using SharpDX.DXGI;
using SharpDX.Direct2D1;
using SharpDX.Direct3D10;

using DXGIResource = SharpDX.DXGI.Resource;
using Device = SharpDX.Direct3D10.Device;
using DxStop = SharpDX.Direct2D1.GradientStop;
using Factory = SharpDX.Direct2D1.Factory;
using Resource = SharpDX.Direct3D10.Resource;

namespace Frost.DirectX.Common
{
	public class Surface2D : ISurface2D, IEquatable<Surface2D>, IDisposable
	{
		//TODO: add configuration option for surface 2d cache limit?
		public const int CacheLimit = 5;

		private static long _AvailableUniqueId;

		private readonly Device2D _Device2D;
		private readonly Device _Device3D;

		private readonly CacheDictionary<Gradient, LinearGradientBrush>
			_LinearGradientBrushes;

		private readonly CacheDictionary<Gradient, RadialGradientBrush>
			_RadialGradientBrushes;
{'fraction_non_alphanumeric': 0.0768143261074458, 'fraction_numerical': 0.02544769085768143, 'mean_word_length': 5.433333333333334, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5648650', 'n_tokens_mistral': 763, 'n_tokens_neox': 639, 'n_words': 178}