Changeset 167017 in webkit


Ignore:
Timestamp:
Apr 9, 2014 10:05:18 AM (10 years ago)
Author:
andersca@apple.com
Message:

Use std::array in AffineTransform, and get rid of setMatrix
https://bugs.webkit.org/show_bug.cgi?id=131416

Reviewed by Sam Weinig.

  • platform/graphics/transforms/AffineTransform.cpp:

(WebCore::AffineTransform::AffineTransform):
(WebCore::AffineTransform::multiply):

  • platform/graphics/transforms/AffineTransform.h:

(WebCore::AffineTransform::setMatrix): Deleted.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167016 r167017  
     12014-04-09  Anders Carlsson  <andersca@apple.com>
     2
     3        Use std::array in AffineTransform, and get rid of setMatrix
     4        https://bugs.webkit.org/show_bug.cgi?id=131416
     5
     6        Reviewed by Sam Weinig.
     7
     8        * platform/graphics/transforms/AffineTransform.cpp:
     9        (WebCore::AffineTransform::AffineTransform):
     10        (WebCore::AffineTransform::multiply):
     11        * platform/graphics/transforms/AffineTransform.h:
     12        (WebCore::AffineTransform::setMatrix): Deleted.
     13
    1142014-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
    215
  • trunk/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp

    r166989 r167017  
    3939
    4040AffineTransform::AffineTransform()
    41 {
    42     setMatrix(1, 0, 0, 1, 0, 0);
     41    : m_transform { { 1, 0, 0, 1, 0, 0 } }
     42{
    4343}
    4444
    4545AffineTransform::AffineTransform(double a, double b, double c, double d, double e, double f)
    46 {
    47     setMatrix(a, b, c, d, e, f);
     46    : m_transform { { a, b, c, d, e, f } }
     47{
    4848}
    4949
     
    131131    trans.m_transform[5] = other.m_transform[4] * m_transform[1] + other.m_transform[5] * m_transform[3] + m_transform[5];
    132132
    133     setMatrix(trans.m_transform);
     133    *this = trans;
    134134    return *this;
    135135}
  • trunk/Source/WebCore/platform/graphics/transforms/AffineTransform.h

    r165676 r167017  
    2828#define AffineTransform_h
    2929
    30 #include <string.h> // for memcpy
     30#include <array>
    3131#include <wtf/FastMalloc.h>
    3232
     
    5151    WTF_MAKE_FAST_ALLOCATED;
    5252public:
    53     typedef double Transform[6];
    54 
    5553    AffineTransform();
    5654    AffineTransform(double a, double b, double c, double d, double e, double f);
     
    188186
    189187private:
    190     void setMatrix(const Transform m)
    191     {
    192         if (m && m != m_transform)
    193             memcpy(m_transform, m, sizeof(Transform));
    194     }
    195 
    196     Transform m_transform;
     188    std::array<double, 6> m_transform;
    197189};
    198190
Note: See TracChangeset for help on using the changeset viewer.