⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 113780 in webkit


Ignore:
Timestamp:
Apr 10, 2012, 3:33:40 PM (14 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/10912486> CanvasRenderingContext2D does not expose its backing store resolution
https://bugs.webkit.org/show_bug.cgi?id=83619

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/canvas/2d.backingStorePixelRatio.html

Added a backingStorePixelRatio attribute to CanvasRenderingContext2D, as proposed in
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-March/035112.html>. The attribute
is prefixed with “webkit” for now.

  • html/HTMLCanvasElement.h:

(WebCore::HTMLCanvasElement::deviceScaleFactor): Added this getter.

  • html/canvas/CanvasRenderingContext2D.h:

(WebCore::CanvasRenderingContext2D::webkitBackingStorePixelRatio): Added. Returns the canvas
element’s device scale factor.
(CanvasRenderingContext2D):

  • html/canvas/CanvasRenderingContext2D.idl: Added webkitBackingStorePixelRatio as a

read-only attribute.

LayoutTests:

  • fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.
  • fast/canvas/2d.backingStorePixelRatio.html: Added.
  • platform/mac/fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.
  • platform/win/fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.
Location:
trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r113779 r113780  
     12012-04-10  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10912486> CanvasRenderingContext2D does not expose its backing store resolution
     4        https://bugs.webkit.org/show_bug.cgi?id=83619
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.
     9        * fast/canvas/2d.backingStorePixelRatio.html: Added.
     10        * platform/mac/fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.
     11        * platform/win/fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.
     12
    1132012-04-10  Dominik Röttsches  <dominik.rottsches@linux.intel.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r113778 r113780  
     12012-04-10  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10912486> CanvasRenderingContext2D does not expose its backing store resolution
     4        https://bugs.webkit.org/show_bug.cgi?id=83619
     5
     6        Reviewed by Simon Fraser.
     7
     8        Test: fast/canvas/2d.backingStorePixelRatio.html
     9
     10        Added a backingStorePixelRatio attribute to CanvasRenderingContext2D, as proposed in
     11        <http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-March/035112.html>. The attribute
     12        is prefixed with “webkit” for now.
     13
     14        * html/HTMLCanvasElement.h:
     15        (WebCore::HTMLCanvasElement::deviceScaleFactor): Added this getter.
     16        * html/canvas/CanvasRenderingContext2D.h:
     17        (WebCore::CanvasRenderingContext2D::webkitBackingStorePixelRatio): Added. Returns the canvas
     18        element’s device scale factor.
     19        (CanvasRenderingContext2D):
     20        * html/canvas/CanvasRenderingContext2D.idl: Added webkitBackingStorePixelRatio as a
     21        read-only attribute.
     22
    1232012-04-10  Mario Sanchez Prada  <msanchez@igalia.com>
    224
  • trunk/Source/WebCore/html/HTMLCanvasElement.h

    r111872 r113780  
    136136    bool shouldAccelerate(const IntSize&) const;
    137137
     138    float deviceScaleFactor() const { return m_deviceScaleFactor; }
     139
    138140private:
    139141    HTMLCanvasElement(const QualifiedName&, Document*);
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h

    r108597 r113780  
    201201    void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&);
    202202
     203    float webkitBackingStorePixelRatio() const { return canvas()->deviceScaleFactor(); }
     204
    203205    void reset();
    204206
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl

    r107304 r113780  
    221221                               in [Optional=DefaultIsUndefined] float sw, in [Optional=DefaultIsUndefined] float sh)
    222222            raises(DOMException);
     223
     224        readonly attribute float webkitBackingStorePixelRatio;
    223225    };
    224226
Note: See TracChangeset for help on using the changeset viewer.