Changeset 225121 in webkit


Ignore:
Timestamp:
Nov 23, 2017, 1:33:44 PM (8 years ago)
Author:
Simon Fraser
Message:

Add support for CanvasPattern.setTransform()
https://bugs.webkit.org/show_bug.cgi?id=179935

Reviewed by Sam Weinig.

Source/WebCore:

Add support for setTransform() on CanvasPattern, per
<https://html.spec.whatwg.org/multipage/canvas.html#dom-canvaspattern-settransform>
It uses [MayThrowException] since the "validate and fixup" steps for DOMMatrix can throw
an exception.

Under the hood, the transform is just pushed onto Pattern as the patternSpaceTransform().

Minor cleanup in Pattern.

Test: fast/canvas/canvas-pattern-with-transform.html

  • html/canvas/CanvasPattern.cpp:

(WebCore::CanvasPattern::setTransform):

  • html/canvas/CanvasPattern.h:
  • html/canvas/CanvasPattern.idl:
  • platform/graphics/Pattern.h:

LayoutTests:

Moved the test previously known as canvas-pattern-transform.html to canvas-pattern-with-transform.html
and added a new test.

  • fast/canvas/canvas-pattern-transform-expected.txt:
  • fast/canvas/canvas-pattern-transform.html:
  • fast/canvas/canvas-pattern-with-transform-expected.txt: Copied from LayoutTests/fast/canvas/canvas-pattern-transform-expected.txt.
  • fast/canvas/canvas-pattern-with-transform.html: Copied from LayoutTests/fast/canvas/canvas-pattern-transform.html.
  • fast/canvas/canvas-pattern-with-transform.js: Renamed from LayoutTests/fast/canvas/canvas-pattern-transform.js.
Location:
trunk
Files:
9 edited
2 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r225116 r225121  
     12017-11-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add support for CanvasPattern.setTransform()
     4        https://bugs.webkit.org/show_bug.cgi?id=179935
     5
     6        Reviewed by Sam Weinig.
     7       
     8        Moved the test previously known as canvas-pattern-transform.html to canvas-pattern-with-transform.html
     9        and added a new test.
     10
     11        * fast/canvas/canvas-pattern-transform-expected.txt:
     12        * fast/canvas/canvas-pattern-transform.html:
     13        * fast/canvas/canvas-pattern-with-transform-expected.txt: Copied from LayoutTests/fast/canvas/canvas-pattern-transform-expected.txt.
     14        * fast/canvas/canvas-pattern-with-transform.html: Copied from LayoutTests/fast/canvas/canvas-pattern-transform.html.
     15        * fast/canvas/canvas-pattern-with-transform.js: Renamed from LayoutTests/fast/canvas/canvas-pattern-transform.js.
     16
    1172017-11-23  Ms2ger  <Ms2ger@igalia.com>
    218
  • trunk/LayoutTests/fast/canvas/canvas-pattern-transform-expected.txt

    r38308 r225121  
    1 Series of tests to ensure correct behaviour on transform of a pattern
    2 
    3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    4 
    5 
    6 PASS imgdata[4] is 0
    7 PASS imgdata[5] is 255
    8 PASS imgdata[6] is 0
    9 PASS imgdata[4] is 255
    10 PASS imgdata[5] is 0
    11 PASS imgdata[6] is 0
    12 PASS imgdata[4] is 0
    13 PASS imgdata[5] is 255
    14 PASS imgdata[6] is 0
    151PASS successfullyParsed is true
    162
    173TEST COMPLETE
     4PASS function () {
     5                ctx.setTransform({a: 1, m11: 11, b: 2, m12: 12, c: 3, m21: 21, d: 4, m22: 22, e: 5, m41: 41, f: 6, m42: 42});
     6            } threw exception TypeError: init.a and init.m11 do not match.
    187
     8Testing canvas repeat transform  pattern transform
     9Checking point 4 4
     10PASS imgdata[0] is expectedRed
     11PASS imgdata[1] is expectedGreen
     12PASS imgdata[2] is expectedBlue
     13Checking point 124 124
     14PASS imgdata[0] is expectedRed
     15PASS imgdata[1] is expectedGreen
     16PASS imgdata[2] is expectedBlue
     17Checking point 64 32
     18PASS imgdata[0] is expectedRed
     19PASS imgdata[1] is expectedGreen
     20PASS imgdata[2] is expectedBlue
     21Checking point 64 96
     22PASS imgdata[0] is expectedRed
     23PASS imgdata[1] is expectedGreen
     24PASS imgdata[2] is expectedBlue
     25Checking point 32 64
     26PASS imgdata[0] is expectedRed
     27PASS imgdata[1] is expectedGreen
     28PASS imgdata[2] is expectedBlue
     29Checking point 96 64
     30PASS imgdata[0] is expectedRed
     31PASS imgdata[1] is expectedGreen
     32PASS imgdata[2] is expectedBlue
     33Checking point 32 32
     34PASS imgdata[0] is expectedRed
     35PASS imgdata[1] is expectedGreen
     36PASS imgdata[2] is expectedBlue
     37Checking point 96 32
     38PASS imgdata[0] is expectedRed
     39PASS imgdata[1] is expectedGreen
     40PASS imgdata[2] is expectedBlue
     41Checking point 96 32
     42PASS imgdata[0] is expectedRed
     43PASS imgdata[1] is expectedGreen
     44PASS imgdata[2] is expectedBlue
     45Checking point 96 96
     46PASS imgdata[0] is expectedRed
     47PASS imgdata[1] is expectedGreen
     48PASS imgdata[2] is expectedBlue
     49
     50Testing canvas no-repeat transform  pattern transform scale(0.5)
     51Checking point 2 2
     52PASS imgdata[0] is expectedRed
     53PASS imgdata[1] is expectedGreen
     54PASS imgdata[2] is expectedBlue
     55Checking point 31 31
     56PASS imgdata[0] is expectedRed
     57PASS imgdata[1] is expectedGreen
     58PASS imgdata[2] is expectedBlue
     59Checking point 6 6
     60PASS imgdata[0] is expectedRed
     61PASS imgdata[1] is expectedGreen
     62PASS imgdata[2] is expectedBlue
     63Checking point 16 16
     64PASS imgdata[0] is expectedRed
     65PASS imgdata[1] is expectedGreen
     66PASS imgdata[2] is expectedBlue
     67Checking point 64 64
     68PASS imgdata[0] is expectedRed
     69PASS imgdata[1] is expectedGreen
     70PASS imgdata[2] is expectedBlue
     71Checking point 96 96
     72PASS imgdata[0] is expectedRed
     73PASS imgdata[1] is expectedGreen
     74PASS imgdata[2] is expectedBlue
     75
     76Testing canvas repeat transform  pattern transform rotate(45deg)
     77Checking point 2 2
     78PASS imgdata[0] is expectedRed
     79PASS imgdata[1] is expectedGreen
     80PASS imgdata[2] is expectedBlue
     81Checking point 42 2
     82PASS imgdata[0] is expectedRed
     83PASS imgdata[1] is expectedGreen
     84PASS imgdata[2] is expectedBlue
     85Checking point 42 64
     86PASS imgdata[0] is expectedRed
     87PASS imgdata[1] is expectedGreen
     88PASS imgdata[2] is expectedBlue
     89Checking point 32 32
     90PASS imgdata[0] is expectedRed
     91PASS imgdata[1] is expectedGreen
     92PASS imgdata[2] is expectedBlue
     93Checking point 96 96
     94PASS imgdata[0] is expectedRed
     95PASS imgdata[1] is expectedGreen
     96PASS imgdata[2] is expectedBlue
     97
     98Testing canvas repeat transform  pattern transform translate(32px, 0)
     99Checking point 4 4
     100PASS imgdata[0] is expectedRed
     101PASS imgdata[1] is expectedGreen
     102PASS imgdata[2] is expectedBlue
     103Checking point 124 124
     104PASS imgdata[0] is expectedRed
     105PASS imgdata[1] is expectedGreen
     106PASS imgdata[2] is expectedBlue
     107Checking point 64 32
     108PASS imgdata[0] is expectedRed
     109PASS imgdata[1] is expectedGreen
     110PASS imgdata[2] is expectedBlue
     111Checking point 2 96
     112PASS imgdata[0] is expectedRed
     113PASS imgdata[1] is expectedGreen
     114PASS imgdata[2] is expectedBlue
     115
     116Testing canvas repeat transform  pattern transform translate(32px, 32px) rotate(45deg) scale(0.5)
     117Checking point 24 24
     118PASS imgdata[0] is expectedRed
     119PASS imgdata[1] is expectedGreen
     120PASS imgdata[2] is expectedBlue
     121Checking point 104 104
     122PASS imgdata[0] is expectedRed
     123PASS imgdata[1] is expectedGreen
     124PASS imgdata[2] is expectedBlue
     125Checking point 22 64
     126PASS imgdata[0] is expectedRed
     127PASS imgdata[1] is expectedGreen
     128PASS imgdata[2] is expectedBlue
     129Checking point 90 112
     130PASS imgdata[0] is expectedRed
     131PASS imgdata[1] is expectedGreen
     132PASS imgdata[2] is expectedBlue
     133Checking point 16 32
     134PASS imgdata[0] is expectedRed
     135PASS imgdata[1] is expectedGreen
     136PASS imgdata[2] is expectedBlue
     137Checking point 82 58
     138PASS imgdata[0] is expectedRed
     139PASS imgdata[1] is expectedGreen
     140PASS imgdata[2] is expectedBlue
     141
     142Testing canvas repeat transform scale(0.5) pattern transform rotate(45deg)
     143Checking point 4 4
     144PASS imgdata[0] is expectedRed
     145PASS imgdata[1] is expectedGreen
     146PASS imgdata[2] is expectedBlue
     147Checking point 62 62
     148PASS imgdata[0] is expectedRed
     149PASS imgdata[1] is expectedGreen
     150PASS imgdata[2] is expectedBlue
     151Checking point 2 24
     152PASS imgdata[0] is expectedRed
     153PASS imgdata[1] is expectedGreen
     154PASS imgdata[2] is expectedBlue
     155Checking point 24 2
     156PASS imgdata[0] is expectedRed
     157PASS imgdata[1] is expectedGreen
     158PASS imgdata[2] is expectedBlue
     159Checking point 24 2
     160PASS imgdata[0] is expectedRed
     161PASS imgdata[1] is expectedGreen
     162PASS imgdata[2] is expectedBlue
     163Checking point 32 48
     164PASS imgdata[0] is expectedRed
     165PASS imgdata[1] is expectedGreen
     166PASS imgdata[2] is expectedBlue
     167Checking point 66 4
     168PASS imgdata[0] is expectedRed
     169PASS imgdata[1] is expectedGreen
     170PASS imgdata[2] is expectedBlue
     171Checking point 4 66
     172PASS imgdata[0] is expectedRed
     173PASS imgdata[1] is expectedGreen
     174PASS imgdata[2] is expectedBlue
     175Checking point 104 104
     176PASS imgdata[0] is expectedRed
     177PASS imgdata[1] is expectedGreen
     178PASS imgdata[2] is expectedBlue
     179
  • trunk/LayoutTests/fast/canvas/canvas-pattern-transform.html

    r155263 r225121  
    1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
     1<!DOCTYPE HTML>
    22<html>
    3 <head>
    4 <script src="../../resources/js-test-pre.js"></script>
    5 </head>
    6 <body>
    7 <script src="canvas-pattern-transform.js"></script>
    8 <script src="../../resources/js-test-post.js"></script>
    9 </body>
     3  <head>
     4    <style>
     5        canvas {
     6            border: 1px solid black;
     7            margin: 10px;
     8        }
     9    </style>
     10    <script src="../../resources/js-test-pre.js"></script>
     11    <script>
     12        var patternCanvas;
     13        function drawOneCanvas(canvas, repeat, transform, patternTransform)
     14        {
     15            var context = canvas.getContext('2d');
     16
     17            context.fillStyle = 'black';
     18            context.fillRect(0, 0, canvas.width, canvas.height);
     19
     20            var pattern = context.createPattern(patternCanvas, repeat);
     21
     22            var patternMatrix = new DOMMatrix;
     23            if (patternTransform)
     24                patternMatrix.setMatrixValue(patternTransform);
     25            if ('setTransform' in pattern)
     26                pattern.setTransform(patternMatrix);
     27
     28            if (transform) {
     29                var matrix = new DOMMatrix;
     30                matrix.setMatrixValue(transform);
     31                context.setTransform(matrix);
     32            }
     33
     34            context.fillStyle = pattern;
     35            context.fillRect(0, 0, canvas.width, canvas.height);
     36        }
     37
     38        function createPatternCanvas()
     39        {
     40            patternCanvas = document.createElement('canvas');
     41            patternCanvas.height = 64;
     42            patternCanvas.width = 64;
     43
     44            var context = patternCanvas.getContext('2d');
     45
     46            context.fillStyle = 'blue';
     47            context.fillRect(0, 0, patternCanvas.width, patternCanvas.height);
     48
     49            context.fillStyle = 'green';
     50            const borderWidth = 8;
     51            context.fillRect(borderWidth, borderWidth, patternCanvas.width - 2 * borderWidth, patternCanvas.height - 2 * borderWidth);
     52        }
     53       
     54        function setupCanvas(data)
     55        {
     56            var canvas = document.createElement('canvas');
     57            canvas.height = 128;
     58            canvas.width = 128;
     59
     60            drawOneCanvas(canvas, data.repeat, data.transform, data.patternTransform);
     61           
     62            debug('');
     63            debug('Testing canvas ' + data.repeat + ' transform ' + data.transform + ' pattern transform ' + data.patternTransform);
     64            return canvas;
     65        }
     66       
     67        function testCanvas(canvas, testData)
     68        {
     69            var test;
     70            for (test of testData)
     71                checkPixel(canvas, test.x, test.y, test.r, test.g, test.b);
     72        }
     73
     74        var imgdata;
     75        var expectedRed;
     76        var expectedGreen;
     77        var expectedBlue;
     78        function checkPixel(canvas, x, y, r, g, b)
     79        {
     80            var context = canvas.getContext('2d');
     81            var imageData = context.getImageData(x, y, 1, 1);
     82            imgdata = imageData.data;
     83           
     84            debug('Checking point ' + x + ' ' + y);
     85            expectedRed = r;
     86            expectedGreen = g;
     87            expectedBlue = b;
     88            shouldBe("imgdata[0]", "expectedRed");
     89            shouldBe("imgdata[1]", "expectedGreen");
     90            shouldBe("imgdata[2]", "expectedBlue");
     91        }
     92       
     93        function testInvalidMatrix()
     94        {
     95            var testCanvas = document.createElement('canvas');
     96            testCanvas.height = 64;
     97            testCanvas.width = 64;
     98
     99            var ctx = testCanvas.getContext('2d');
     100
     101            shouldThrowErrorName(function() {
     102                ctx.setTransform({a: 1, m11: 11, b: 2, m12: 12, c: 3, m21: 21, d: 4, m22: 22, e: 5, m41: 41, f: 6, m42: 42});
     103            }, "TypeError");
     104        }
     105
     106        function doTest()
     107        {
     108            testInvalidMatrix();
     109            createPatternCanvas();
     110
     111            const tests = [
     112                {
     113                    repeat : 'repeat',
     114                    transform : '',
     115                    patternTransform : '',
     116                    test : [
     117                        // Check two corners for blue.
     118                        { x : 4, y : 4, r : 0, g : 0, b : 255 },
     119                        { x : 124, y : 124, r : 0, g : 0, b : 255 },
     120                        // Check for blue cross in the middle.
     121                        { x : 64, y : 32, r : 0, g : 0, b : 255 },
     122                        { x : 64, y : 96, r : 0, g : 0, b : 255 },
     123                        { x : 32, y : 64, r : 0, g : 0, b : 255 },
     124                        { x : 96, y : 64, r : 0, g : 0, b : 255 },
     125                        // Four fields of green.
     126                        { x : 32, y : 32, r : 0, g : 128, b : 0 },
     127                        { x : 96, y : 32, r : 0, g : 128, b : 0 },
     128                        { x : 96, y : 32, r : 0, g : 128, b : 0 },
     129                        { x : 96, y : 96, r : 0, g : 128, b : 0 },
     130                    ],
     131                },
     132                {
     133                    repeat : 'no-repeat',
     134                    transform : '',
     135                    patternTransform : 'scale(0.5)',
     136                    test : [
     137                        // Check two corners for blue.
     138                        { x : 2, y : 2, r : 0, g : 0, b : 255 },
     139                        { x : 31, y : 31, r : 0, g : 0, b : 255 },
     140                        // Green near corner and middle.
     141                        { x : 6, y : 6, r : 0, g : 128, b : 0 },
     142                        { x : 16, y : 16, r : 0, g : 128, b : 0 },
     143                        // Mostly black
     144                        { x : 64, y : 64, r : 0, g : 0, b : 0 },
     145                        { x : 96, y : 96, r : 0, g : 0, b : 0 },
     146                    ],
     147                },
     148                {
     149                    repeat: 'repeat',
     150                    transform: '',
     151                    patternTransform: 'rotate(45deg)',
     152                    test : [
     153                        // Check two corners for blue.
     154                        { x : 2, y : 2, r : 0, g : 0, b : 255 },
     155                        // Green at top edge due to rotation.
     156                        { x : 42, y : 2, r : 0, g : 128, b : 0 },
     157                        { x : 42, y : 64, r : 0, g : 128, b : 0 },
     158                        // Blue diagonal.
     159                        { x : 32, y : 32, r : 0, g : 0, b : 255 },
     160                        { x : 96, y : 96, r : 0, g : 0, b : 255 },
     161                    ],
     162                },
     163                {
     164                    repeat: 'repeat',
     165                    transform: '',
     166                    patternTransform: 'translate(32px, 0)',
     167                    test : [
     168                        // Check two corners for blue.
     169                        { x : 4, y : 4, r : 0, g : 0, b : 255 },
     170                        { x : 124, y : 124, r : 0, g : 0, b : 255 },
     171                        // Green is offset half pattern width.
     172                        { x : 64, y : 32, r : 0, g : 128, b : 0 },
     173                        { x : 2, y : 96, r : 0, g : 128, b : 0 },
     174                    ],
     175                },
     176                {
     177                    repeat: 'repeat',
     178                    transform: '',
     179                    patternTransform: 'translate(32px, 32px) rotate(45deg) scale(0.5)',
     180                    test : [
     181                        // Blue diagonals
     182                        { x : 24, y : 24, r : 0, g : 0, b : 255 },
     183                        { x : 104, y : 104, r : 0, g : 0, b : 255 },
     184                        { x : 22, y : 64, r : 0, g : 0, b : 255 },
     185                        { x : 90, y : 112, r : 0, g : 0, b : 255 },
     186                        // Green centers.
     187                        { x : 16, y : 32, r : 0, g : 128, b : 0 },
     188                        { x : 82, y : 58, r : 0, g : 128, b : 0 },
     189                    ],
     190                },
     191                {
     192                    repeat: 'repeat',
     193                    transform: 'scale(0.5)',
     194                    patternTransform: 'rotate(45deg)',
     195                    test : [
     196                        // Blue diagonals
     197                        { x : 4, y : 4, r : 0, g : 0, b : 255 },
     198                        { x : 62, y : 62, r : 0, g : 0, b : 255 },
     199
     200                        // Green centers.
     201                        { x : 2, y : 24, r : 0, g : 128, b : 0 },
     202                        { x : 24, y : 2, r : 0, g : 128, b : 0 },
     203                        { x : 24, y : 2, r : 0, g : 128, b : 0 },
     204                        { x : 32, y : 48, r : 0, g : 128, b : 0 },
     205
     206                        // Mostly black
     207                        { x : 66, y : 4, r : 0, g : 0, b : 0 },
     208                        { x : 4, y : 66, r : 0, g : 0, b : 0 },
     209                        { x : 104, y : 104, r : 0, g : 0, b : 0 },
     210                    ],
     211                },
     212            ];
     213
     214            var testData;
     215            for (testData of tests) {
     216                var canvas = setupCanvas(testData);
     217                testCanvas(canvas, testData.test);
     218            }
     219        }
     220     
     221      window.addEventListener('load', doTest, false);
     222    </script>
     223  </head>
     224  <body>
     225  </body>
     226  <script src="../../resources/js-test-post.js"></script>
    10227</html>
  • trunk/LayoutTests/fast/canvas/canvas-pattern-with-transform.html

    r225120 r225121  
    55</head>
    66<body>
    7 <script src="canvas-pattern-transform.js"></script>
     7<script src="canvas-pattern-with-transform.js"></script>
    88<script src="../../resources/js-test-post.js"></script>
    99</body>
  • trunk/Source/WebCore/ChangeLog

    r225120 r225121  
     12017-11-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add support for CanvasPattern.setTransform()
     4        https://bugs.webkit.org/show_bug.cgi?id=179935
     5
     6        Reviewed by Sam Weinig.
     7       
     8        Add support for setTransform() on CanvasPattern, per
     9        <https://html.spec.whatwg.org/multipage/canvas.html#dom-canvaspattern-settransform>
     10        It uses [MayThrowException] since the "validate and fixup" steps for DOMMatrix can throw
     11        an exception.
     12       
     13        Under the hood, the transform is just pushed onto Pattern as the patternSpaceTransform().
     14       
     15        Minor cleanup in Pattern.
     16
     17        Test: fast/canvas/canvas-pattern-with-transform.html
     18
     19        * html/canvas/CanvasPattern.cpp:
     20        (WebCore::CanvasPattern::setTransform):
     21        * html/canvas/CanvasPattern.h:
     22        * html/canvas/CanvasPattern.idl:
     23        * platform/graphics/Pattern.h:
     24
    1252017-11-23  Sam Weinig  <sam@webkit.org>
    226
  • trunk/Source/WebCore/html/canvas/CanvasPattern.cpp

    r223728 r225121  
    11/*
    2  * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2008, 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2727#include "CanvasPattern.h"
    2828
     29#include "DOMMatrix2DInit.h"
     30#include "DOMMatrixReadOnly.h"
    2931#include "Image.h"
    3032#include "Pattern.h"
     
    7173}
    7274
     75ExceptionOr<void> CanvasPattern::setTransform(DOMMatrix2DInit&& matrixInit)
     76{
     77    auto checkValid = DOMMatrixReadOnly::validateAndFixup(matrixInit);
     78    if (checkValid.hasException())
     79        return checkValid.releaseException();
     80
     81    m_pattern->setPatternSpaceTransform({ matrixInit.a.value_or(1), matrixInit.b.value_or(0), matrixInit.c.value_or(0), matrixInit.d.value_or(1), matrixInit.e.value_or(0), matrixInit.f.value_or(0) });
     82    return { };
     83}
     84
    7385} // namespace WebCore
  • trunk/Source/WebCore/html/canvas/CanvasPattern.h

    r207720 r225121  
    11/*
    2  * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2008, 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
     28#include "ExceptionOr.h"
    2829#include <wtf/Forward.h>
    2930#include <wtf/Ref.h>
     
    3435class Image;
    3536class Pattern;
     37struct DOMMatrix2DInit;
    3638
    3739class CanvasPattern : public RefCounted<CanvasPattern> {
     
    4648
    4749    bool originClean() const { return m_originClean; }
     50   
     51    ExceptionOr<void> setTransform(DOMMatrix2DInit&&);
    4852
    4953private:
  • trunk/Source/WebCore/html/canvas/CanvasPattern.idl

    r221598 r225121  
    2929] interface CanvasPattern {
    3030    // opaque object
    31     // FIXME: Implement setTransform.
    32     // void setTransform(optional DOMMatrix2DInit transform);
     31    [MayThrowException] void setTransform(optional DOMMatrix2DInit transform);
    3332};
  • trunk/Source/WebCore/platform/graphics/Pattern.h

    r222971 r225121  
    2626 */
    2727
    28 #ifndef Pattern_h
    29 #define Pattern_h
     28#pragma once
    3029
    3130#include "AffineTransform.h"
     
    6766#endif
    6867    void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation);
    69     const AffineTransform& getPatternSpaceTransform() { return m_patternSpaceTransformation; };
     68    const AffineTransform& patternSpaceTransform() { return m_patternSpaceTransformation; };
    7069    bool repeatX() const { return m_repeatX; }
    7170    bool repeatY() const { return m_repeatY; }
     
    7574
    7675    Ref<Image> m_tileImage;
     76    AffineTransform m_patternSpaceTransformation;
    7777    bool m_repeatX;
    7878    bool m_repeatY;
    79     AffineTransform m_patternSpaceTransformation;
    8079};
    8180
    8281} //namespace
    8382
    84 #endif
  • trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp

    r223728 r225121  
    319319
    320320    auto& patternImage = state.fillPattern->tileImage();
    321     const AffineTransform& patternTransform = state.fillPattern->getPatternSpaceTransform();
     321    const AffineTransform& patternTransform = state.fillPattern->patternSpaceTransform();
    322322    FloatRect patternRect = patternTransform.mapRect(FloatRect(0, 0, patternImage.width(), patternImage.height()));
    323323
Note: See TracChangeset for help on using the changeset viewer.