You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
+#define CACHE_COLOR_BURSH
+
using System;
using System.Collections.Generic;
using System.Linq;
public D2D.SolidColorBrush Get(D2D.RenderTarget render,Color4 key)
{
D2D.SolidColorBrush brush;
+
+#if CACHE_COLOR_BURSH
bool result = cache.TryGetValue(key, out brush);
if (!result)
{
brush = new D2D.SolidColorBrush(render, key);
cache.Add(key, brush);
}
+#else
+ brush = new D2D.SolidColorBrush(render, key);
+#endif
return brush;
}
}
}
#endif
-
}
class D2DRenderCommon : IDisposable