HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/7031

File a bug

SVNBugCommentTime (UTC)
7031[Gecko] [Internet Explorer] [Opera] [Webkit] Provide a switch to disable drawImage()'s smoothing.2012-03-27 22:06
Index: source
===================================================================
--- source	(revision 7030)
+++ source	(revision 7031)
@@ -40640,6 +40640,7 @@
   <span>TextMetrics</span> <span title="dom-context-2d-measureText">measureText</span>(DOMString text);
 
   // drawing images
+           attribute boolean <span title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</span>; // (default true)
   void <span title="dom-context-2d-drawImage">drawImage</span>((<span>HTMLImageElement</span> or <span>HTMLCanvasElement</span> or <span>HTMLVideoElement</span>) image, double dx, double dy);
   void <span title="dom-context-2d-drawImage">drawImage</span>((<span>HTMLImageElement</span> or <span>HTMLCanvasElement</span> or <span>HTMLVideoElement</span>) image, double dx, double dy, double dw, double dh);
   void <span title="dom-context-2d-drawImage">drawImage</span>((<span>HTMLImageElement</span> or <span>HTMLCanvasElement</span> or <span>HTMLVideoElement</span>) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
@@ -44340,6 +44341,20 @@
 
    </dd>
 
+   <dt><var title="">context</var> . <code title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code> [ = <var title="">value</var> ]</dt>
+
+   <dd>
+
+    <p>Returns whether the <code
+    title="dom-context-2d-drawImage">drawImage()</code> method will
+    attempt to smooth the image if it has to rescale it (as opposed to
+    just rendering the image with "big pixels").</p>
+
+    <p>Can be set, to change whether images are smoothed (true) or not
+    (false).</p>
+
+   </dd>
+
   </dl>
 
   <div class="impl">
@@ -44427,9 +44442,18 @@
   suggested that 5,5,-2,-2 was different than 3,3,2,2; this is trying
   to clarify that this is no the case. --></p>
 
-  <p class="note">This specification does not define the algorithm to
-  use when scaling the image, if necessary.</p>
+  <p>If the <code
+  title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code>
+  attribute is set to true, then the user agent should attempt to
+  apply a smoothing algorithm to the image data when it is scaled.
+  Otherwise, the image must be rendered using nearest-neighbor
+  interpolation.</p>
 
+  <p class="note">This specification does not define the precise
+  algorithm to use when scaling an image when the <code
+  title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code>
+  attribute is set to true.</p>
+
   <p class="note">When a canvas is drawn onto itself, the <span>drawing
   model</span> requires the source to be copied before the image is drawn
   back onto the canvas, so it is possible to copy parts of a canvas
@@ -44473,6 +44497,13 @@
   title="dom-context-2d-globalCompositeOperation">global composition
   operators</span>.</p>
 
+  <p>The <dfn
+  title="dom-context-2d-imageSmoothingEnabled"><code>imageSmoothingEnabled</code></dfn>
+  attribute, on getting, must return the last value it was set to. On
+  setting, it must be set to the new value. When the
+  <code>CanvasRenderingContext2D</code> object is create, the
+  attribute must be set to true.</p>
+
   </div>
 
 

|