Updated Branches:
  refs/heads/develop 6ab7bd4d1 -> 1f85dd80c

FLEX-33728 added access to imageDecodingPolicy


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/1f85dd80
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/1f85dd80
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/1f85dd80

Branch: refs/heads/develop
Commit: 1f85dd80c32156d41f0a12b7413b139cc7d06c75
Parents: 6ab7bd4
Author: Justin Mclean <[email protected]>
Authored: Sun Sep 15 19:18:50 2013 +1000
Committer: Justin Mclean <[email protected]>
Committed: Sun Sep 15 19:18:50 2013 +1000

----------------------------------------------------------------------
 .../spark/src/spark/primitives/BitmapImage.as   | 22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1f85dd80/frameworks/projects/spark/src/spark/primitives/BitmapImage.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/primitives/BitmapImage.as 
b/frameworks/projects/spark/src/spark/primitives/BitmapImage.as
index c786b45..0a66e24 100644
--- a/frameworks/projects/spark/src/spark/primitives/BitmapImage.as
+++ b/frameworks/projects/spark/src/spark/primitives/BitmapImage.as
@@ -39,6 +39,7 @@ import flash.geom.Rectangle;
 import flash.net.URLRequest;
 import flash.system.ApplicationDomain;
 import flash.system.Capabilities;
+import flash.system.ImageDecodingPolicy;
 import flash.system.LoaderContext;
 import flash.utils.ByteArray;
 
@@ -505,6 +506,20 @@ public class BitmapImage extends GraphicElement
         else
             return 0.5;
     }
+       
+       /**
+        *  The image decoding policy, set to ImageDecodingPolicy.ON_DEMAND
+        *  or ImageDecodingPolicy.ON_LOAD.
+        *  The default is ImageDecodingPolicy.ON_DEMAND.
+        * 
+        *  Setting to asynchronously decode and load the bitmap images for
+        *  large image may improve your application’s perceived performance.
+        * 
+        *  @langversion 3.0
+        *  @playerversion AIR 2.6
+        *  @productversion Flex 4.11
+        */
+       public var imageDecodingPolicy:String = ImageDecodingPolicy.ON_DEMAND;
 
     //----------------------------------
     //  preliminaryHeight
@@ -1516,6 +1531,9 @@ public class BitmapImage extends GraphicElement
             var loader:Loader = new Loader();
             var loaderContext:LoaderContext = new LoaderContext();
 
+                       if (imageDecodingPolicy in loaderContext)
+                               loaderContext.imageDecodingPolicy = 
imageDecodingPolicy;
+                               
             // Attach load-event listeners to our LoaderInfo instance.
             loadingContent = loader.contentLoaderInfo;
             attachLoadingListeners();
@@ -1541,6 +1559,10 @@ public class BitmapImage extends GraphicElement
     {
         var loader:Loader = new Loader();
         var loaderContext:LoaderContext = new LoaderContext();
+               
+               if (imageDecodingPolicy in loaderContext)
+                       loaderContext.imageDecodingPolicy = imageDecodingPolicy;
+               
         loadingContent = loader.contentLoaderInfo;
         attachLoadingListeners();
 

Reply via email to