changeset 136:1a5fd362114d

Updated dependency: Guava 13.0.1.
author Mikhail Kryshen <mikhail@kryshen.net>
date Tue, 18 Sep 2012 14:43:26 +0400
parents 7eddb035d9c4
children 748f4eba4f58
files project.clj src/net/kryshen/indyvon/layers.clj
diffstat 2 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/project.clj	Thu Apr 26 19:23:04 2012 +0400
+++ b/project.clj	Tue Sep 18 14:43:26 2012 +0400
@@ -3,7 +3,7 @@
   :url "https://bitbucket.org/kryshen/indyvon"
   :warn-on-reflection true
   :dependencies [[org.clojure/clojure "1.3.0"]
-                 [com.google.guava/guava "11.0.1"]]
+                 [com.google.guava/guava "13.0.1"]]
   ;;:aot [net.kryshen.indyvon.core
   ;;      net.kryshen.indyvon.async
   ;;      net.kryshen.indyvon.layers
--- a/src/net/kryshen/indyvon/layers.clj	Thu Apr 26 19:23:04 2012 +0400
+++ b/src/net/kryshen/indyvon/layers.clj	Tue Sep 18 14:43:26 2012 +0400
@@ -183,16 +183,15 @@
   (-> (CacheBuilder/newBuilder)
       (.softValues)
       (.expireAfterAccess (long 1) TimeUnit/SECONDS)
-      (.build
-       (proxy [CacheLoader] []
-         (load [[^String s ^Font f ^FontRenderContext frc]]
-           (TextLayout. s f frc))))))
+      (.build)))
 
-(defn- get-text-layout [line font font-context]
-  (.get text-layout-cache [line font font-context]))
+(defn- get-text-layout
+  [^String line ^Font font ^FontRenderContext font-context]
+  (.get text-layout-cache [line font font-context]
+        #(TextLayout. line font font-context)))
 
 (defn- layout-text
-  [lines ^Font font ^FontRenderContext font-context]
+  [lines font font-context]
   (map #(get-text-layout % font font-context) lines))
 
 (defn- text-width [layouts]