From 1859906f9f8a4f84edba474e70a2806247075f08 Mon Sep 17 00:00:00 2001 From: aki Date: Sat, 28 Jun 2008 23:47:26 +0530 Subject: [PATCH] Examples updated to the latest Camel Case .. Was a pain converting them --- testcases/phpCairo/a1-image-sample-php.png | Bin 148 -> 148 bytes testcases/phpCairo/a1-image-sample.php | 16 +- testcases/phpCairo/a1-mask-php.png | Bin 131 -> 131 bytes testcases/phpCairo/a1-mask.php | 12 +- testcases/phpCairo/a1-traps-sample-php.png | Bin 148 -> 148 bytes testcases/phpCairo/a1-traps-sample.php | 8 +- testcases/phpCairo/a8-mask-php.png | Bin 128 -> 128 bytes testcases/phpCairo/a8-mask.php | 12 +- testcases/phpCairo/big-line-php.png | Bin 1427 -> 1427 bytes testcases/phpCairo/big-line.php | 58 ++-- testcases/phpCairo/bilevel-image-php.png | Bin 131 -> 131 bytes testcases/phpCairo/bilevel-image.php | 24 +- testcases/phpCairo/bitmap-font-php.png | Bin 3734 -> 3734 bytes testcases/phpCairo/bitmap-font.php | 106 ++++---- testcases/phpCairo/caps-joins-php.png | Bin 1488 -> 1488 bytes testcases/phpCairo/caps-joins.php | 128 ++++----- testcases/phpCairo/caps-sub-paths-php.png | Bin 197 -> 197 bytes testcases/phpCairo/caps-sub-paths.php | 41 +-- testcases/phpCairo/clip-all-php.png | Bin 118 -> 118 bytes testcases/phpCairo/clip-all.php | 16 +- testcases/phpCairo/clip-empty-php.png | Bin 118 -> 118 bytes testcases/phpCairo/clip-empty.php | 18 +- testcases/phpCairo/clip-fill-rule-php.png | Bin 431 -> 431 bytes testcases/phpCairo/clip-fill-rule.php | 28 +- testcases/phpCairo/clip-nesting-php.png | Bin 1050 -> 1050 bytes testcases/phpCairo/clip-nesting.php | 20 +- testcases/phpCairo/clip-operator-php.png | Bin 8058 -> 8058 bytes testcases/phpCairo/clip-operator.php | 56 ++-- testcases/phpCairo/clip-push-group-php.png | Bin 199 -> 199 bytes testcases/phpCairo/clip-push-group.php | 10 +- testcases/phpCairo/clip-twice-php.png | Bin 1287 -> 1287 bytes testcases/phpCairo/clip-twice.php | 72 ++--- testcases/phpCairo/close-path.php | 20 +- .../composite-integer-translate-over-php.png | Bin 16385 -> 16385 bytes ...composite-integer-translate-over-repeat-php.png | Bin 401 -> 401 bytes .../composite-integer-translate-over-repeat.php | 18 +- .../phpCairo/composite-integer-translate-over.php | 10 +- .../composite-integer-translate-source-php.png | Bin 16385 -> 16385 bytes ....php => composite-integer-translate-source.php} | 10 +- testcases/phpCairo/create-from-png-php.png | Bin 119 -> 119 bytes testcases/phpCairo/create-from-png-stream-php.png | Bin 119 -> 119 bytes testcases/phpCairo/create-from-png-stream.php | 6 +- testcases/phpCairo/create-from-png.php | 6 +- testcases/phpCairo/dash-caps-joins-php.png | Bin 4718 -> 4718 bytes testcases/phpCairo/dash-caps-joins.php | 146 +++++----- testcases/phpCairo/dash-curve-php.png | Bin 41763 -> 41763 bytes testcases/phpCairo/dash-curve.php | 64 +++-- testcases/phpCairo/dash-scale-php.png | Bin 7908 -> 7908 bytes testcases/phpCairo/dash-scale.php | 300 ++++++++++----------- testcases/phpCairo/dashes.php | 14 +- testcases/phpCairo/degenerate-arc-php.png | Bin 619 -> 619 bytes testcases/phpCairo/degenerate-arc.php | 24 +- testcases/phpCairo/degenerate-path-php.png | Bin 257 -> 257 bytes testcases/phpCairo/degenerate-path.php | 50 ++-- testcases/phpCairo/degenerate-pen-php.png | Bin 1080 -> 1080 bytes testcases/phpCairo/degenerate-pen.php | 29 +- testcases/phpCairo/device-offset-php.png | Bin 137 -> 137 bytes testcases/phpCairo/device-offset-positive-php.png | Bin 139 -> 139 bytes testcases/phpCairo/device-offset-positive.php | 16 +- ...evice-offset-positive.php => device-offset.php} | 17 +- testcases/phpCairo/extend-pad.php | 21 +- testcases/phpCairo/extend-reflect.php | 10 +- testcases/phpCairo/extend-repeat-similar.php | 39 ++- testcases/phpCairo/extend-repeat.php | 12 +- testcases/phpCairo/fill-and-stroke-php.png | Bin 279 -> 279 bytes testcases/phpCairo/fill-and-stroke.php | 12 +- .../phpCairo/fill-degenerate-sort-order-php.png | Bin 2397 -> 2397 bytes testcases/phpCairo/fill-degenerate-sort-order.php | 40 +-- testcases/phpCairo/fill-missed-stop-php.png | Bin 466 -> 466 bytes testcases/phpCairo/fill-missed-stop.php | 16 +- testcases/phpCairo/fill-rule.php | 34 +-- testcases/phpCairo/filter-bilinear-extents-php.png | Bin 817 -> 817 bytes testcases/phpCairo/filter-bilinear-extents.php | 10 +- testcases/phpCairo/finer-grained-fallbacks-php.png | Bin 715 -> 715 bytes testcases/phpCairo/finer-grained-fallbacks.php | 18 +- testcases/phpCairo/font-matrix-translation-php.png | Bin 816 -> 816 bytes testcases/phpCairo/font-matrix-translation.php | 30 +-- testcases/phpCairo/get-group-target-php.png | Bin 134 -> 134 bytes testcases/phpCairo/get-group-target.php | 16 +- testcases/phpCairo/gradient-alpha-php.png | Bin 0 -> 145 bytes testcases/phpCairo/gradient-alpha.php | 12 + testcases/phpCairo/gradient-zero-stops-php.png | Bin 0 -> 105 bytes testcases/phpCairo/gradient-zero-stops.php | 17 ++ testcases/phpCairo/group-paint-php.png | Bin 0 -> 118 bytes testcases/phpCairo/group-paint.php | 15 ++ testcases/phpCairo/image.png | Bin 7809 -> 7809 bytes testcases/phpCairo/image_dash.png | Bin 0 -> 3898 bytes testcases/phpCairo/image_text_extents.png | Bin 6933 -> 6933 bytes testcases/phpCairo/infinite-join-php.png | Bin 0 -> 194 bytes testcases/phpCairo/infinite-join.php | 24 ++ testcases/phpCairo/large-font-php.png | Bin 0 -> 6938 bytes testcases/phpCairo/large-font.php | 15 ++ testcases/phpCairo/large-source-php.png | Bin 137 -> 137 bytes testcases/phpCairo/large-source.php | 28 +- testcases/phpCairo/leaky-dash-php.png | Bin 0 -> 243 bytes testcases/phpCairo/leaky-dash.php | 24 ++ testcases/phpCairo/leaky-dashed-rectangle-php.png | Bin 415 -> 415 bytes testcases/phpCairo/leaky-dashed-rectangle.php | 20 +- testcases/phpCairo/line-width-scale-php.png | Bin 6445 -> 6445 bytes testcases/phpCairo/line-width-scale.php | 18 +- testcases/phpCairo/linear-gradient-reflect-php.png | Bin 217 -> 217 bytes testcases/phpCairo/linear-gradient-reflect.php | 12 +- testcases/phpCairo/long-lines-php.png | Bin 0 -> 290 bytes testcases/phpCairo/long-lines.php | 41 +++ testcases/phpCairo/mask-ctm-php.png | Bin 139 -> 139 bytes testcases/phpCairo/mask-ctm.php | 8 +- testcases/phpCairo/mask-surface-ctm-php.png | Bin 134 -> 139 bytes testcases/phpCairo/mask-surface-ctm.php | 14 +- testcases/phpCairo/meta-surface-pattern-php.png | Bin 3072 -> 3072 bytes testcases/phpCairo/meta-surface-pattern.php | 60 ++--- testcases/phpCairo/miter-precision-php.png | Bin 985 -> 985 bytes testcases/phpCairo/miter-precision.php | 16 +- testcases/phpCairo/move-to-show-surface-php.png | Bin 116 -> 116 bytes testcases/phpCairo/move-to-show.php | 6 +- testcases/phpCairo/nil-surface.php | 12 +- testcases/phpCairo/operator-clear-php.png | Bin 1180 -> 1180 bytes testcases/phpCairo/operator-clear.php | 52 ++-- testcases/phpCairo/operator-source.php | 64 ++--- testcases/phpCairo/over-above-source-php.png | Bin 538 -> 538 bytes testcases/phpCairo/over-above-source.php | 18 +- testcases/phpCairo/over-between-source-php.png | Bin 575 -> 575 bytes testcases/phpCairo/over-between-source.php | 76 +++--- testcases/phpCairo/paint-source-alpha-php.png | Bin 163 -> 163 bytes testcases/phpCairo/paint-source-alpha.php | 11 +- testcases/phpCairo/pdf-surface-source-php.png | Bin 351 -> 351 bytes testcases/phpCairo/pdf-surface-source.pdf | Bin 2211 -> 1994 bytes testcases/phpCairo/pdf-surface-source.php | 20 +- testcases/phpCairo/ps-surface-source-php.png | Bin 351 -> 351 bytes testcases/phpCairo/ps-surface-source.php | 22 +- ...pdf-surface-source.pdf => ps-surface-source.ps} | 2 +- testcases/phpCairo/random-intersection-php.png | Bin 10751 -> 10751 bytes testcases/phpCairo/random-intersections.php | 20 +- .../phpCairo/rectangle-rounding-error-php.png | Bin 298 -> 298 bytes testcases/phpCairo/rectangle-rounding-error.php | 10 +- testcases/phpCairo/rectilinear-stroke.php | 202 +++++++------- testcases/phpCairo/reflected-stroke-php.png | Bin 5487 -> 5487 bytes testcases/phpCairo/reflected-stroke.php | 20 +- .../phpCairo/rotate-image-surface-paint-php.png | Bin 270 -> 270 bytes testcases/phpCairo/rotate-image-surface-paint.php | 20 +- .../scale-down-source-surface-paint-php.png | Bin 133 -> 133 bytes .../phpCairo/scale-down-source-surface-paint.php | 13 +- .../phpCairo/scale-source-surface-paint-php.png | Bin 147 -> 147 bytes testcases/phpCairo/scale-source-surface-paint.php | 13 +- testcases/phpCairo/select-font-face-php.png | Bin 1528 -> 1528 bytes testcases/phpCairo/select-font-face.php | 22 +- testcases/phpCairo/self-copy-php.png | Bin 291 -> 291 bytes testcases/phpCairo/self-copy.php | 16 +- testcases/phpCairo/self-intersecting-php.png | Bin 254 -> 254 bytes testcases/phpCairo/self-intersecting.php | 20 +- testcases/phpCairo/set-source-php.png | Bin 120 -> 120 bytes testcases/phpCairo/set-source.php | 14 +- testcases/phpCairo/show-text-current-point-php.png | Bin 1848 -> 1848 bytes testcases/phpCairo/show-text-current-point.php | 46 ++-- testcases/phpCairo/source-clip-php.png | Bin 133 -> 133 bytes testcases/phpCairo/source-clip.php | 12 +- testcases/phpCairo/sphere.php | 18 +- testcases/phpCairo/temp.pdf | 2 +- testcases/phpCairo/temp.ps | 71 +++++ testcases/phpCairo/temp1.png | Bin 206 -> 206 bytes testcases/phpCairo/test-extents.php | 50 ++-- 160 files changed, 1489 insertions(+), 1300 deletions(-) rewrite testcases/phpCairo/big-line.php (71%) rewrite testcases/phpCairo/bitmap-font.php (83%) rewrite testcases/phpCairo/caps-joins.php (68%) rewrite testcases/phpCairo/caps-sub-paths.php (63%) rewrite testcases/phpCairo/clip-twice.php (64%) copy testcases/phpCairo/{composite-integer-translate-over.php => composite-integer-translate-source.php} (55%) rewrite testcases/phpCairo/dash-caps-joins.php (69%) rewrite testcases/phpCairo/dash-curve.php (64%) rewrite testcases/phpCairo/dash-scale.php (74%) copy testcases/phpCairo/{device-offset-positive.php => device-offset.php} (50%) rewrite testcases/phpCairo/extend-repeat-similar.php (60%) rewrite testcases/phpCairo/fill-degenerate-sort-order.php (75%) create mode 100644 testcases/phpCairo/gradient-alpha-php.png create mode 100644 testcases/phpCairo/gradient-alpha.php create mode 100644 testcases/phpCairo/gradient-zero-stops-php.png create mode 100644 testcases/phpCairo/gradient-zero-stops.php create mode 100644 testcases/phpCairo/group-paint-php.png create mode 100644 testcases/phpCairo/group-paint.php create mode 100644 testcases/phpCairo/image_dash.png create mode 100644 testcases/phpCairo/infinite-join-php.png create mode 100644 testcases/phpCairo/infinite-join.php create mode 100644 testcases/phpCairo/large-font-php.png create mode 100644 testcases/phpCairo/large-font.php create mode 100644 testcases/phpCairo/leaky-dash-php.png create mode 100644 testcases/phpCairo/leaky-dash.php create mode 100644 testcases/phpCairo/long-lines-php.png create mode 100644 testcases/phpCairo/long-lines.php rewrite testcases/phpCairo/over-between-source.php (62%) rewrite testcases/phpCairo/pdf-surface-source.pdf (100%) copy testcases/phpCairo/{pdf-surface-source.pdf => ps-surface-source.ps} (98%) rewrite testcases/phpCairo/rectilinear-stroke.php (62%) rewrite testcases/phpCairo/show-text-current-point.php (63%) create mode 100644 testcases/phpCairo/temp.ps rewrite testcases/phpCairo/test-extents.php (68%) diff --git a/testcases/phpCairo/a1-image-sample-php.png b/testcases/phpCairo/a1-image-sample-php.png index b61048a37f4fa2b7a0cbb0ef57c15c151e5828f2..0c3807f7839ff36049e34838ac1eb92b81ebe7eb 100644 GIT binary patch delta 18 ZcwU>rIE8V79fu4zyX9{68{QM$`~WcF1(E;& delta 18 ZcwU>rIE8V79S0Y;vi2Dkhi4Pr`~WY&1%Chl diff --git a/testcases/phpCairo/a1-image-sample.php b/testcases/phpCairo/a1-image-sample.php index 37aa5a5..a9da60e 100644 --- a/testcases/phpCairo/a1-image-sample.php +++ b/testcases/phpCairo/a1-image-sample.php @@ -11,25 +11,25 @@ $s = new CairoImageSurface(FORMAT_ARGB32,1,1); //$s->create_from_data($n, FORMAT_ARGB32, 1, 1, 4); $con = new CairoContext($sur); $c = new CairoContext($s); -$c->set_source_rgb(0,0,0); +$c->setSourceRgb(0,0,0); $c->paint(); -$con->set_source_rgb(1,1,1); +$con->setSourceRgb(1,1,1); $con->paint(); -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->translate($pad, $pad); -$con->set_antialias(ANTIALIAS_NONE); +$con->setAntialias(ANTIALIAS_NONE); for($i = 0; $i < $points; $i++) for($j = 0; $j < $points; $j++) { $t1 = (2 * $i) + (($i+1) * $step); $t2 = (2 * $j) + (($j+1) * $step); - $con->set_source_surface($s, $t1, $t2); - $pat = $con->get_source(); - $pat->set_filter(FILTER_NEAREST); + $con->setSourceSurface($s, $t1, $t2); + $pat = $con->getSource(); + $pat->setFilter(FILTER_NEAREST); $con->paint(); } -$sur->write_to_png('a1-image-sample-php.png'); +$sur->writeToPng('a1-image-sample-php.png'); ?> diff --git a/testcases/phpCairo/a1-mask-php.png b/testcases/phpCairo/a1-mask-php.png index 423a5be1c099db3c3086b0045f5c50bc5301ee28..e6f766a44908ed770040f784b074ddee27adb2c4 100644 GIT binary patch delta 18 ZcwTE}Y-XHb$05VbFJtkmjb);nEdVT)1pxp6 delta 18 ZcwTE}Y-XHb$H67SC8ORt&wrwuEdVNO1keBg diff --git a/testcases/phpCairo/a1-mask.php b/testcases/phpCairo/a1-mask.php index 4b67562..8772325 100644 --- a/testcases/phpCairo/a1-mask.php +++ b/testcases/phpCairo/a1-mask.php @@ -5,7 +5,7 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, $width, $height); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_A1,$width,$height); $str=""; -$stride = $s->get_stride(); +$stride = $s->getStride(); for($i=0; $i<8; $i++) { $str=$str . chr(0x14); @@ -19,11 +19,11 @@ for($i=0; $i<8; $i++) { } echo $str; -$s->create_from_data($str, FORMAT_A1, $width, $height); -$con->set_source_rgb(0,0,1); +$s->createFromData($str, FORMAT_A1, $width, $height); +$con->setSourceRgb(0,0,1); $con->paint(); -$con->set_source_rgb(1,0,0); -$con->mask_surface($s,0,0); -$sur->write_to_png("a1-mask-php.png"); +$con->setSourceRgb(1,0,0); +$con->maskSurface($s,0,0); +$sur->writeToPng("a1-mask-php.png"); ?> diff --git a/testcases/phpCairo/a1-traps-sample-php.png b/testcases/phpCairo/a1-traps-sample-php.png index 4c92906580f76181601496092226d983c422cfb0..0e5aeea9ea4d830ba5d2962249c4a6ddc5a31cb3 100644 GIT binary patch delta 18 acwU>rIE8V79fu4zzuLcV@!KZ4`2henj|PhX delta 18 ZcwU>rIE8V79S4_?tYCzd)U}CjegG^Q1o8j? diff --git a/testcases/phpCairo/a1-traps-sample.php b/testcases/phpCairo/a1-traps-sample.php index 9590719..422bb6c 100644 --- a/testcases/phpCairo/a1-traps-sample.php +++ b/testcases/phpCairo/a1-traps-sample.php @@ -11,12 +11,12 @@ $con = new CairoContext($sur); //$c = new CairoContext($s); //$c->set_source_rgb(0,0,0); //$c->paint(); -$con->set_source_rgb(1,1,1); +$con->setSourceRgb(1,1,1); $con->paint(); -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->translate($pad, $pad); -$con->set_antialias(ANTIALIAS_NONE); +$con->setAntialias(ANTIALIAS_NONE); for($i = 0; $i < $points; $i++) for($j = 0; $j < $points; $j++) { @@ -28,7 +28,7 @@ for($i = 0; $i < $points; $i++) $con->rectangle($t1, $t2, 1, 1); $con->fill(); } -$sur->write_to_png('a1-traps-sample-php.png'); +$sur->writeToPng('a1-traps-sample-php.png'); ?> diff --git a/testcases/phpCairo/a8-mask-php.png b/testcases/phpCairo/a8-mask-php.png index 1aafa6b7151cc7d8657b2a5bdc5e38a4371ca0a3..26d08c3103240c5307e992d77701dc1a6bb245af 100644 GIT binary patch delta 18 ZcwTE@Y+#&V$05VbuifCT%stV~3IHgV1V8`) delta 18 ZcwTE@Y+#&V$H66RZE{gby=kJG6#y+h1rh)N diff --git a/testcases/phpCairo/a8-mask.php b/testcases/phpCairo/a8-mask.php index b2e875c..c752bc5 100644 --- a/testcases/phpCairo/a8-mask.php +++ b/testcases/phpCairo/a8-mask.php @@ -5,7 +5,7 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, $width, $height); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_A8,$width,$height); $str=""; -$stride = $s->get_stride(); +$stride = $s->getStride(); for($i=0; $i<8; $i++) { $str=$str . chr(0); @@ -19,11 +19,11 @@ for($i=0; $i<8; $i++) { } echo $str; -$s->create_from_data($str, FORMAT_A8, $width, $height); -$con->set_source_rgb(0,0,1); +$s->createFromData($str, FORMAT_A8, $width, $height); +$con->setSourceRgb(0,0,1); $con->paint(); -$con->set_source_rgb(1,0,0); -$con->mask_surface($s,0,0); -$sur->write_to_png("a8-mask-php.png"); +$con->setSourceRgb(1,0,0); +$con->maskSurface($s,0,0); +$sur->writeToPng("a8-mask-php.png"); ?> diff --git a/testcases/phpCairo/big-line-php.png b/testcases/phpCairo/big-line-php.png index d2ecbef1cb821ff411853963f6e4f15bd9e465c2..7310e41cdecbb323f0e46640c6dbd2b73fce8d3e 100644 GIT binary patch delta 19 bcwU>#J(+ug9fu6JsN#kF2In@q`LY54J4psc delta 19 acwU>#J(+ug9S4_)q+Z|NzSxa!zN`Q_QU&(_ diff --git a/testcases/phpCairo/big-line.php b/testcases/phpCairo/big-line.php dissimilarity index 71% index 1c95ab0..45c8144 100644 --- a/testcases/phpCairo/big-line.php +++ b/testcases/phpCairo/big-line.php @@ -1,29 +1,29 @@ -set_source_rgb(0,0,1); -$con->move_to(50,50); -$con->line_to(50000,50000); -$con->stroke(); - -$con->set_source_rgb(0,1,0); -$con->move_to(50,50); -$con->line_to(-50000,50000); -$con->stroke(); - -$con->set_source_rgb(1,0,0); -$con->move_to(50,50); -$con->line_to(50000,-50000); -$con->stroke(); - -$con->set_source_rgb(1,1,0); -$con->move_to(50,50); -$con->line_to(-50000,-50000); -$con->stroke(); - -$sur->write_to_png("big-line-php.png"); -?> +setSourceRgb(0,0,1); +$con->moveTo(50,50); +$con->lineTo(50000,50000); +$con->stroke(); + +$con->setSourceRgb(0,1,0); +$con->moveTo(50,50); +$con->lineTo(-50000,50000); +$con->stroke(); + +$con->setSourceRgb(1,0,0); +$con->moveTo(50,50); +$con->lineTo(50000,-50000); +$con->stroke(); + +$con->setSourceRgb(1,1,0); +$con->moveTo(50,50); +$con->lineTo(-50000,-50000); +$con->stroke(); + +$sur->writeToPng("big-line-php.png"); +?> diff --git a/testcases/phpCairo/bilevel-image-php.png b/testcases/phpCairo/bilevel-image-php.png index 7fc0522ef23c626ac44dc40ec76999ec3220a13d..459bea906792b94bdf244fb17d3ff90f7ca561ea 100644 GIT binary patch delta 18 ZcwTE}Y-XHb$05TlEM@+#E@z^fEdVXj1y%q6 delta 18 ZcwTE}Y-XHb$H65k#mL{>^get_stride(); -echo $stride; -echo "uu"; +$stride = $s->getStride(); for($i=0; $i<12; $i++) { $str=$str . chr(0x00); //blue $str=$str . chr(0x00);//green @@ -25,25 +23,15 @@ for($i=0; $i<12; $i++) { $str=$str . chr(0xff); $str=$str . chr(0xff); $str=$str . chr(0xff); -/* - $str=$str . chr(0x0000ff00); - $str=$str . chr(0x000000ff); - $str=$str . chr(0x00000000); - $str=$str . chr(255); - $str=$str . chr(0); - $str=$str . chr(0); - $str=$str . chr(0);*/ } -echo strlen($str); -$s->create_from_data($str, FORMAT_ARGB32, $width, $height); -$wid = $s->get_height(); -echo $wid; -$con->set_source_rgb(1,1,1); +$s->createFromData($str, FORMAT_ARGB32, $width, $height); +$wid = $s->getHeight(); +$con->setSourceRgb(1,1,1); $con->paint(); -$con->set_source_surface($s,0,0); +$con->setSourceSurface($s,0,0); //$con->mask_surface($s,0,0); $con->paint(); -$sur->write_to_png("bilevel-image-php.png"); +$sur->writeToPng("bilevel-image-php.png"); ?> diff --git a/testcases/phpCairo/bitmap-font-php.png b/testcases/phpCairo/bitmap-font-php.png index 6ba221e1b65a0b9418a3174bcd0de959ca253b91..47d675dc13e47ee9f53d865d8eb37eedf07b969a 100644 GIT binary patch delta 19 acwU<(J56?i9fu6JuoX{3+>(uM0ek>AUIml@ delta 19 bcwU<(J56?i9S1kJq_xkom-9Bd1@Hj?Jp~4J diff --git a/testcases/phpCairo/bitmap-font.php b/testcases/phpCairo/bitmap-font.php dissimilarity index 83% index 266a157..99a0edc 100644 --- a/testcases/phpCairo/bitmap-font.php +++ b/testcases/phpCairo/bitmap-font.php @@ -1,53 +1,53 @@ -select_font_face("6x13.pcf"); -$con->set_font_size(11.5); -$fo = new CairoFontOptions(); -$fo->set_hint_metrics(HINT_METRICS_ON); -$con->set_font_options($fo); -$fe = $con->font_extents(); -$con->move_to(1,$fe["ascent"] - 1); -$con->set_source_rgb(0,0,1); -$fo->set_hint_style(HINT_STYLE_NONE); -$con->set_font_options($fo); -$con->show_text("the "); -$fo->set_hint_style(HINT_STYLE_SLIGHT); -$con->set_font_options($fo); -$con->show_text("quick "); -$fo->set_hint_style(HINT_STYLE_MEDIUM); -$con->set_font_options($fo); -$con->show_text("brown"); -$fo->set_hint_style(HINT_STYLE_FULL); -$con->set_font_options($fo); -$con->show_text(" fox"); - -$con->text_path(" jumps over a lazy dog"); -$con->fill(); - -$con->translate($width, $height); -$con->rotate(M_PI); - -$con->move_to(1, $fe["height"]-$fe["descent"]-1); -$fo->set_hint_metrics(HINT_METRICS_OFF); -$fo->set_hint_style(HINT_STYLE_NONE); -$con->set_font_options($fo); -$con->show_text("the "); -$fo->set_hint_style(HINT_STYLE_SLIGHT); -$con->set_font_options($fo); -$con->show_text("quick"); -$fo->set_hint_style(HINT_STYLE_MEDIUM); -$con->set_font_options($fo); -$con->show_text(" brown"); -$fo->set_hint_style(HINT_STYLE_FULL); -$con->set_font_options($fo); -$con->show_text(" fox"); - -$con->text_path(" jumps over"); -$con->text_path(" a lazy dog"); -$con->fill(); -$sur->write_to_png("bitmap-font-php.png"); -?> - +selectFontFace("6x13.pcf"); +$con->setFontSize(11.5); +$fo = new CairoFontOptions(); +$fo->setHintMetrics(HINT_METRICS_ON); +$con->setFontOptions($fo); +$fe = $con->fontExtents(); +$con->moveTo(1,$fe["ascent"] - 1); +$con->setSourceRgb(0,0,1); +$fo->setHintStyle(HINT_STYLE_NONE); +$con->setFontOptions($fo); +$con->showText("the "); +$fo->setHintStyle(HINT_STYLE_SLIGHT); +$con->setFontOptions($fo); +$con->showText("quick "); +$fo->setHintStyle(HINT_STYLE_MEDIUM); +$con->setFontOptions($fo); +$con->showText("brown"); +$fo->setHintStyle(HINT_STYLE_FULL); +$con->setFontOptions($fo); +$con->showText(" fox"); + +$con->textPath(" jumps over a lazy dog"); +$con->fill(); + +$con->translate($width, $height); +$con->rotate(M_PI); + +$con->moveTo(1, $fe["height"]-$fe["descent"]-1); +$fo->setHintMetrics(HINT_METRICS_OFF); +$fo->setHintStyle(HINT_STYLE_NONE); +$con->setFontOptions($fo); +$con->showText("the "); +$fo->setHintStyle(HINT_STYLE_SLIGHT); +$con->setFontOptions($fo); +$con->showText("quick"); +$fo->setHintStyle(HINT_STYLE_MEDIUM); +$con->setFontOptions($fo); +$con->showText(" brown"); +$fo->setHintStyle(HINT_STYLE_FULL); +$con->setFontOptions($fo); +$con->showText(" fox"); + +$con->textPath(" jumps over"); +$con->textPath(" a lazy dog"); +$con->fill(); +$sur->writeToPng("bitmap-font-php.png"); +?> + diff --git a/testcases/phpCairo/caps-joins-php.png b/testcases/phpCairo/caps-joins-php.png index ac43465058ea932d79107071db758cb821d8d3bc..cfc89ea0bd4d88fd8c315e008d67c21799421544 100644 GIT binary patch delta 19 acwW1}eSv#|9fu6Rm@&W7u9+L%x>x}{4+aYW delta 19 acwW1}eSv#|9S1kJuG*BYvJD&Ex>x~1V+Ozg diff --git a/testcases/phpCairo/caps-joins.php b/testcases/phpCairo/caps-joins.php dissimilarity index 68% index c459488..ff9be9c 100644 --- a/testcases/phpCairo/caps-joins.php +++ b/testcases/phpCairo/caps-joins.php @@ -1,64 +1,64 @@ -save(); -$con->set_source_rgb(1,1,1); -$con->paint(); -$con->restore(); - -$con->set_line_width($linewidth); -$con->translate($pad, $pad); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); - -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0,3*$linewidth); - -$con->set_line_cap(LINE_CAP_BUTT); -$con->set_line_join(LINE_JOIN_BEVEL); -$con->stroke(); - -$con->translate($size+$pad, 0); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); - -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0,3*$linewidth); - -$con->set_line_cap(LINE_CAP_ROUND); -$con->set_line_join(LINE_JOIN_ROUND); -$con->stroke(); - -$con->translate($size+$pad,0); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); - -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0,3*$linewidth); - -$con->set_line_cap(LINE_CAP_SQUARE); -$con->set_line_join(LINE_JOIN_MITER); -$con->stroke(); -$sur->write_to_png("caps-joins-php.png"); -?> - - - - +save(); +$con->setSourceRgb(1,1,1); +$con->paint(); +$con->restore(); + +$con->setLineWidth($linewidth); +$con->translate($pad, $pad); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); + +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0,3*$linewidth); + +$con->setLineCap(LINE_CAP_BUTT); +$con->setLineJoin(LINE_JOIN_BEVEL); +$con->stroke(); + +$con->translate($size+$pad, 0); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); + +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0,3*$linewidth); + +$con->setLineCap(LINE_CAP_ROUND); +$con->setLineJoin(LINE_JOIN_ROUND); +$con->stroke(); + +$con->translate($size+$pad,0); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); + +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0,3*$linewidth); + +$con->setLineCap(LINE_CAP_SQUARE); +$con->setLineJoin(LINE_JOIN_MITER); +$con->stroke(); +$sur->writeToPng("caps-joins-php.png"); +?> + + + + diff --git a/testcases/phpCairo/caps-sub-paths-php.png b/testcases/phpCairo/caps-sub-paths-php.png index 526943d1bcbb7dd59858bad6b6756eeaa2404407..6d4a689e163c7e87ac375ec16f2a272f518df9fb 100644 GIT binary patch delta 18 acwRfoc$9I19fu6RxWJaUU#lj%)dK)JLk7VB delta 18 ZcwRfoc$9I19S1j$zD(->+pH7a>H#?r244UG diff --git a/testcases/phpCairo/caps-sub-paths.php b/testcases/phpCairo/caps-sub-paths.php dissimilarity index 63% index 7c1bf3a..9893628 100644 --- a/testcases/phpCairo/caps-sub-paths.php +++ b/testcases/phpCairo/caps-sub-paths.php @@ -1,20 +1,21 @@ -save(); -$con->set_source_rgb(1,1,1); -$con->paint(); -$con->restore(); - -$con->set_line_width(4); -$con->set_line_cap(LINE_CAP_ROUND); -$con->move_to(4,4); -$con->line_to(4,16); -$con->move_to(10,4); -$con->line_to(10,16); -$con->move_to(16,4); -$con->line_to(16,16); - -$con->stroke(); -$sur->write_to_png("caps-sub-paths-php.png"); +save(); +$con->setSourceRgb(1,1,1); +$con->paint(); +$con->restore(); + +$con->setLineWidth(4); +$con->setLineCap(LINE_CAP_ROUND); +$con->moveTo(4,4); +$con->lineTo(4,16); +$con->moveTo(10,4); +$con->lineTo(10,16); +$con->moveTo(16,4); +$con->lineTo(16,16); + +$con->stroke(); +$sur->writeToPng("caps-sub-paths-php.png"); +?> diff --git a/testcases/phpCairo/clip-all-php.png b/testcases/phpCairo/clip-all-php.png index 15d40bd2a87b82e489761f2d09782cb5405af242..6407beb3fe669d30c36b04c745c3bf39118a6196 100644 GIT binary patch delta 16 XcwQ?jn_$Nw!!Ita+@q{C(ait=B@_f3 delta 16 XcwQ?jn_$Pm&C4h9tWxLkL^lHfE6@dU diff --git a/testcases/phpCairo/clip-all.php b/testcases/phpCairo/clip-all.php index 8091473..bbe0b39 100644 --- a/testcases/phpCairo/clip-all.php +++ b/testcases/phpCairo/clip-all.php @@ -2,10 +2,10 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 10, 10); $con = new CairoContext($sur); $con->rectangle(0,0,10,10); -$con->set_source_rgb(0,0,1); +$con->setSourceRgb(0,0,1); $con->fill(); -$con->reset_clip(); +$con->resetClip(); $con->rectangle(2,2,2,2); $con->clip(); $con->rectangle(6,6,2,2); @@ -13,16 +13,16 @@ $con->clip(); $con->translate(0.5,0.5); -$con->reset_clip(); +$con->resetClip(); $con->rectangle(2,2,2,2); $con->clip(); $con->rectangle(6,6,6,6); $con->clip(); $con->rectangle(0,0,10,10); -$con->set_source_rgb(1,1,0); +$con->setSourceRgb(1,1,0); $con->fill(); -$con->select_font_face("Bitstream Vera Sans", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); -$con->move_to(0,10); -$con->show_text("cairo"); -$sur->write_to_png("clip-all-php.png"); +$con->selectFontFace("Bitstream Vera Sans", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); +$con->moveTo(0,10); +$con->showText("cairo"); +$sur->writeToPng("clip-all-php.png"); diff --git a/testcases/phpCairo/clip-empty-php.png b/testcases/phpCairo/clip-empty-php.png index ccc1f81f31909382282835331b98990f399bf77f..d932ad237a16b3cfae84c61a9bf7664da814db8c 100644 GIT binary patch delta 16 XcwQ?jn_$Nw!!NGP-8XyBL^lHfDR>1R delta 16 XcwQ?jn_$Pm%`484S#fjAL^lHfD)j|# diff --git a/testcases/phpCairo/clip-empty.php b/testcases/phpCairo/clip-empty.php index 1f56ba7..c495156 100644 --- a/testcases/phpCairo/clip-empty.php +++ b/testcases/phpCairo/clip-empty.php @@ -1,10 +1,10 @@ set_source_rgb(0,0,1); +$con->setSourceRgb(0,0,1); $con->paint(); -$con->reset_clip(); +$con->resetClip(); //$con->rectangle(2,2,2,2); $con->clip(); //$con->rectangle(6,6,2,2); @@ -12,18 +12,18 @@ $con->clip(); $con->translate(0.5,0.5); -$con->set_source_rgb(0,1,0); +$con->setSourceRgb(0,1,0); //$con->reset_clip(); $con->rectangle(0,0,10,10); //$con->clip(); //$con->rectangle(6,6,6,6); //$con->clip(); -$con->fill_preserve(); +$con->fillPreserve(); //$con->rectangle(0,0,10,10); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); //$con->fill(); $con->stroke(); -$con->select_font_face("Bitstream Vera Sans", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); -$con->move_to(0,10); -$con->show_text("cairo"); -$sur->write_to_png("clip-empty-php.png"); +$con->selectFontFace("Bitstream Vera Sans", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); +$con->moveTo(0,10); +$con->showText("cairo"); +$sur->writeToPng("clip-empty-php.png"); diff --git a/testcases/phpCairo/clip-fill-rule-php.png b/testcases/phpCairo/clip-fill-rule-php.png index 191dbc7b8719d9d5078ad9c146df8d1471ed5b0b..a432f779d26b03f98ff786a921346c6e40388266 100644 GIT binary patch delta 19 acwSr2yqset_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); //$con->paint(); $con->translate(1,1); $con->save(); -$con->move_to(10, 0); -$con->rel_line_to ( 6, 20); -$con->rel_line_to ( -16, -12); -$con->rel_line_to ( 20, 0); -$con->rel_line_to ( -16, 12); +$con->moveTo(10, 0); +$con->relLineTo ( 6, 20); +$con->relLineTo ( -16, -12); +$con->relLineTo ( 20, 0); +$con->relLineTo ( -16, 12); -$con->set_fill_rule (FILL_RULE_WINDING); +$con->setFillRule (FILL_RULE_WINDING); $con->clip (); $con->paint (); @@ -21,17 +21,17 @@ $con->restore (); $con->translate ($starsize + 1, 0); $con->save (); -$con->move_to(10, 0); -$con->rel_line_to ( 6, 20); -$con->rel_line_to ( -16, -12); -$con->rel_line_to ( 20, 0); -$con->rel_line_to ( -16, 12); +$con->moveTo(10, 0); +$con->relLineTo ( 6, 20); +$con->relLineTo ( -16, -12); +$con->relLineTo ( 20, 0); +$con->relLineTo ( -16, 12); -$con->set_fill_rule (FILL_RULE_EVEN_ODD); +$con->setFillRule (FILL_RULE_EVEN_ODD); $con->clip (); $con->paint (); $con->restore(); -$sur->write_to_png("clip-fill-rule-php.png"); +$sur->writeToPng("clip-fill-rule-php.png"); ?> diff --git a/testcases/phpCairo/clip-nesting-php.png b/testcases/phpCairo/clip-nesting-php.png index 59e66d567a75ade2d0c43c5f6424d9e094e1678c..f4dbbb32d3e4bc8401b6cc96dff750bbb74983da 100644 GIT binary patch delta 19 acwU>uF^gk@9fu6RgoLeZUie10E6e~g{{>?J delta 19 bcwU>uF^gk@9S1i*7t0(q-M1Uvt}p`tHIfDG diff --git a/testcases/phpCairo/clip-nesting.php b/testcases/phpCairo/clip-nesting.php index 9270a69..cefb34c 100644 --- a/testcases/phpCairo/clip-nesting.php +++ b/testcases/phpCairo/clip-nesting.php @@ -4,32 +4,32 @@ $border = 10; $linewidth = 20; $sur = new CairoImageSurface(FORMAT_ARGB32, $size, $size); $con = new CairoContext($sur); -$s = $con->get_group_target(); +$s = $con->getGroupTarget(); $c = new CairoContext($s); -$c->move_to($border, $border); -$c->line_to($border + $linewidth, $border); -$c->line_to($size - $border, $size - $border); -$c->line_to($size - $border-$linewidth, $size - $border); +$c->moveTo($border, $border); +$c->lineTo($border + $linewidth, $border); +$c->lineTo($size - $border, $size - $border); +$c->lineTo($size - $border-$linewidth, $size - $border); $c->clip(); -$c->set_source_rgb(0,0,1); +$c->setSourceRgb(0,0,1); $c->paint(); -$c->set_source_rgb(1,1,1); +$c->setSourceRgb(1,1,1); $c->rectangle($size/2 - $linewidth/2, $border, $linewidth, $size - 2*$border); $c->fill(); $c2 = new CairoContext($sur); -$c2->set_source_rgb(1,1,1); +$c2->setSourceRgb(1,1,1); $c2->rectangle($size - $border - $linewidth, $border, $linewidth, $size - 2 * $border); $c2->fill(); -$con->set_source_rgb(1,1,1); +$con->setSourceRgb(1,1,1); $con->rectangle($border, $border, $linewidth, $size - 2 * $border); $con->fill(); -$sur->write_to_png("clip-nesting-php.png"); +$sur->writeToPng("clip-nesting-php.png"); diff --git a/testcases/phpCairo/clip-operator-php.png b/testcases/phpCairo/clip-operator-php.png index b04fff49cf3d2df7c1fb0955343438b4c7ccfb13..d402f32ed935b43c56ae2e2770f8ce28796817f6 100644 GIT binary patch delta 19 acwYNu_sedA9fu6RB!hX@afgj=Ch`DDM+SWW delta 19 acwYNu_sedA9S66NyqM3Gu1Oo+OymJgSO*^f diff --git a/testcases/phpCairo/clip-operator.php b/testcases/phpCairo/clip-operator.php index 81681bf..1dab39d 100644 --- a/testcases/phpCairo/clip-operator.php +++ b/testcases/phpCairo/clip-operator.php @@ -7,8 +7,8 @@ $imagewidth = $noperator * ($width + $pad) + $pad; $imageheight = 4 * ($height + $pad) + $pad; $sur = new CairoImageSurface(FORMAT_ARGB32, $imagewidth, $imageheight); $con = new CairoContext($sur); -$con->select_font_face("Bitstream Vera Sans"); -$con->set_font_size(0.9 * $height); +$con->selectFontFace("Bitstream Vera Sans"); +$con->setFontSize(0.9 * $height); for($i=0; $i < 4; $i++) { for($op = OPERATOR_CLEAR; $op < $noperator; $op++) { @@ -17,17 +17,17 @@ for($i=0; $i < 4; $i++) { $con->save(); $pat = new CairoLinearGradient($x + $width, $y, $x, $y + $height); - $pat->add_color_stop_rgba(0.2,0,0,1,1); - $pat->add_color_stop_rgba(0.8,0,0,1,0); + $pat->addColorStopRgba(0.2,0,0,1,1); + $pat->addColorStopRgba(0.8,0,0,1,0); - $con->set_source($pat); + $con->setSource($pat); $con->rectangle($x, $y, $width, $height); $con->fill(); - $con->set_operator($op); - $con->set_source_rgb(1,0,0); - $con->move_to($x,$y); - $con->line_to($x+$width, $y); - $con->line_to($x, $y+$height); + $con->setOperator($op); + $con->setSourceRgb(1,0,0); + $con->moveTo($x,$y); + $con->lineTo($x+$width, $y); + $con->lineTo($x, $y+$height); $con->clip(); switch($i) { @@ -38,30 +38,30 @@ for($i=0; $i < 4; $i++) { $y += 0.05 * $height; //$stemp = $con->get_group_target(); - $msur = $sur->create_similar(CONTENT_ALPHA, $wi, $he); + $msur = $sur->createSimilar(CONTENT_ALPHA, $wi, $he); $c2 = new CairoContext($msur); $c2->save(); - $c2->set_source_rgba(0,0,0,0); - $c2->set_operator(OPERATOR_SOURCE); + $c2->setSourceRgba(0,0,0,0); + $c2->setOperator(OPERATOR_SOURCE); $c2->paint(); $c2->restore(); - $c2->set_source_rgb(1,1,1); + $c2->setSourceRgb(1,1,1); $c2->arc(0.5 * $wi, 0.5 * $he, 0.45 * $he, 0, 2 * M_PI); $c2->fill(); //unset($c2); - $con->mask_surface($msur, $x, $y); + $con->maskSurface($msur, $x, $y); //unset($msur); //unset($stemp); break; case 1: - $con->set_font_size(0.9 * $height); - $ext = $con->text_extents("FG"); - $con->move_to($x + floor(($width - $ext["width"])/2 + 0.5) - $ext["x_bearing"], $y + floor(($height - $ext["height"])/2 + 0.5) - $ext["y_bearing"]); - $con->show_text("FG"); + $con->setFontSize(0.9 * $height); + $ext = $con->textExtents("FG"); + $con->moveTo($x + floor(($width - $ext["width"])/2 + 0.5) - $ext["x_bearing"], $y + floor(($height - $ext["height"])/2 + 0.5) - $ext["y_bearing"]); + $con->showText("FG"); break; case 2: @@ -69,14 +69,14 @@ for($i=0; $i < 4; $i++) { $he = floor($height * 9 / 10); $x += 0.05 * $width; $y += 0.05 * $height; - $con->new_path(); - $con->move_to($x, $y); - $con->line_to($x, $y + $he); - $con->line_to($x + $wi/2, $y + 3 * $he/4); - $con->line_to($x + $wi, $y + $he); - $con->line_to($x+$wi, $y); - $con->line_to($x + $wi/2, $y + $he/4); - $con->close_path(); + $con->newPath(); + $con->moveTo($x, $y); + $con->lineTo($x, $y + $he); + $con->lineTo($x + $wi/2, $y + 3 * $he/4); + $con->lineTo($x + $wi, $y + $he); + $con->lineTo($x+$wi, $y); + $con->lineTo($x + $wi/2, $y + $he/4); + $con->closePath(); $con->fill(); break; @@ -96,7 +96,7 @@ for($i=0; $i < 4; $i++) { $con->restore(); } } -$sur->write_to_png("clip-operator-php.png"); +$sur->writeToPng("clip-operator-php.png"); ?> diff --git a/testcases/phpCairo/clip-push-group-php.png b/testcases/phpCairo/clip-push-group-php.png index 99db0224fa8424da98175fc060d5e815723c2b50..c19e623dbc6b464d30d4e98d949c9997d97cf0de 100644 GIT binary patch delta 18 acwRfsc${&99fu6RB>(cOw=Pa}YXks1{s%b# delta 18 ZcwRfsc${&99S66No~mi&8?%XSjQ};a1>XPw diff --git a/testcases/phpCairo/clip-push-group.php b/testcases/phpCairo/clip-push-group.php index 5689e78..3fcb488 100644 --- a/testcases/phpCairo/clip-push-group.php +++ b/testcases/phpCairo/clip-push-group.php @@ -5,16 +5,16 @@ $pad = 2; $sur = new CairoImageSurface(FORMAT_ARGB32, $size, $size); $con = new CairoContext($sur); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); $con->paint(); $con->arc($size/2, $size/2, $size/2 - $pad, 0, 2*M_PI); $con->clip(); -$con->push_group(); -$con->set_source_rgb(0,0,1); +$con->pushGroup(); +$con->setSourceRgb(0,0,1); $con->paint(); -$con->pop_group_to_source(); +$con->popGroupToSource(); $con->paint(); -$sur->write_to_png("clip-push-group-php.png"); +$sur->writeToPng("clip-push-group-php.png"); ?> diff --git a/testcases/phpCairo/clip-twice-php.png b/testcases/phpCairo/clip-twice-php.png index 98db3a52d506c58fda93721561c112a960f37d5b..ca0c32fa5778d52d06f2c37100cc730dbfa04c54 100644 GIT binary patch delta 19 acwTGgYUi3@$05TnDWbbU*mk4aK^6cpIR!cZ delta 19 acwTGgYUi3@$H6VkWnew_path(); -$con->arc($width/2, $height/2, $width/3, 0, 2 * M_PI); -$con->clip(); -$con->new_path(); -$con->move_to(0,0); -$con->line_to($width/4, $height/2); -$con->line_to(0, $height); -$con->line_to($width, $height); -$con->line_to(3*$width/4, $height/2); -$con->line_to($width, 0); -$con->close_path(); -$con->clip(); -$con->set_source_rgb(0,0,0.6); -$con->new_path(); -$con->move_to(0,0); -$con->line_to(0, $height); -$con->line_to($width/2, 3*$height/4); -$con->line_to($width, $height); -$con->line_to($width, 0); -$con->line_to($width/2, $height/4); -$con->close_path(); -$con->fill(); -$con->new_path(); -$con->arc($width/2, $height/2, $width/5, 0, 2 * M_PI); -$con->clip(); -$con->set_source_rgb(1,1,0); -$con->paint(); - - -$sur->write_to_png("clip-twice-php.png"); -?> +newPath(); +$con->arc($width/2, $height/2, $width/3, 0, 2 * M_PI); +$con->clip(); +$con->newPath(); +$con->moveTo(0,0); +$con->lineTo($width/4, $height/2); +$con->lineTo(0, $height); +$con->lineTo($width, $height); +$con->lineTo(3*$width/4, $height/2); +$con->lineTo($width, 0); +$con->closePath(); +$con->clip(); +$con->setSourceRgb(0,0,0.6); +$con->newPath(); +$con->moveTo(0,0); +$con->lineTo(0, $height); +$con->lineTo($width/2, 3*$height/4); +$con->lineTo($width, $height); +$con->lineTo($width, 0); +$con->lineTo($width/2, $height/4); +$con->closePath(); +$con->fill(); +$con->newPath(); +$con->arc($width/2, $height/2, $width/5, 0, 2 * M_PI); +$con->clip(); +$con->setSourceRgb(1,1,0); +$con->paint(); + + +$sur->writeToPng("clip-twice-php.png"); +?> diff --git a/testcases/phpCairo/close-path.php b/testcases/phpCairo/close-path.php index 4888ad7..b65f341 100644 --- a/testcases/phpCairo/close-path.php +++ b/testcases/phpCairo/close-path.php @@ -3,26 +3,26 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 32, 16); $con = new CairoContext($sur); $con->save(); -$con->set_source_rgb(1,1,1); +$con->setSourceRgb(1,1,1); $con->paint(); $con->restore(); $con->arc(8, 8, 4, 0, M_PI); -$con->close_path(); +$con->closePath(); $con->arc(8,8,4,M_PI,2*M_PI); $con->fill(); $con->translate(16,0); -$con->move_to(8,4); -$con->arc_negative(8,8,4,3*M_PI/2,M_PI/2); -$con->close_path(); -$con->curve_to(12,4,12,12,8,12); +$con->moveTo(8,4); +$con->arcNegative(8,8,4,3*M_PI/2,M_PI/2); +$con->closePath(); +$con->curveTo(12,4,12,12,8,12); -$path = $con->copy_path_flat(); -$con->new_path(); -$con->append_path($path); +$path = $con->copyPathFlat(); +$con->newPath(); +$con->appendPath($path); $con->fill(); -$sur->write_to_png("close-path-php.png"); +$sur->writeToPng("close-path-php.png"); ?> diff --git a/testcases/phpCairo/composite-integer-translate-over-php.png b/testcases/phpCairo/composite-integer-translate-over-php.png index b56e9096d061f34761a50963f33dc831182eadae..7022d47cda856a5fa27723a1bba18fe0fde1addc 100644 GIT binary patch delta 21 dcwTF4U~Ft)oM6Wx!!K#{fA6#d8{Kx>0{~F|2vh(7 delta 21 ccwTF4U~Ft)oM6Yn&tV{Sa;?AWMz`Je07+5@7XSbN diff --git a/testcases/phpCairo/composite-integer-translate-over-repeat-php.png b/testcases/phpCairo/composite-integer-translate-over-repeat-php.png index 752c72828fdc9cfaf21e8154db3733d3f0b5e760..e23f31ea3096426f2abfafb56ce16c4333c28e92 100644 GIT binary patch delta 19 acwU>xJdt^V9fu6Rq-N=jc%6-I-i!b?Oa+Gk delta 19 acwU>xJdt^V9S1*$74L?LN*Np7ycq#CRt0MS diff --git a/testcases/phpCairo/composite-integer-translate-over-repeat.php b/testcases/phpCairo/composite-integer-translate-over-repeat.php index 3eeed64..adaad8a 100644 --- a/testcases/phpCairo/composite-integer-translate-over-repeat.php +++ b/testcases/phpCairo/composite-integer-translate-over-repeat.php @@ -6,30 +6,30 @@ $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32,20, 20); $con2 = new CairoContext($s); -$con2->set_source_rgba(1,0,0,1); +$con2->setSourceRgba(1,0,0,1); $con2->rectangle(0,0,10,10); $con2->fill(); -$con2->set_source_rgba(0,1,0,1); +$con2->setSourceRgba(0,1,0,1); $con2->rectangle(10,0,10,10); $con2->fill(); -$con2->set_source_rgba(0,0,1,1); +$con2->setSourceRgba(0,0,1,1); $con2->rectangle(0,10,10,10); $con2->fill(); -$con2->set_source_rgba(1,1,0,1); +$con2->setSourceRgba(1,1,0,1); $con2->rectangle(10,10,10,10); $con2->fill(); $pat = new CairoSurfacePattern($s); -$pat->set_extend(EXTEND_REPEAT); -$con->set_source_rgba(0,0,0,1); +$pat->setExtend(EXTEND_REPEAT); +$con->setSourceRgba(0,0,0,1); $con->rectangle(0,0,100,100); $con->fill(); $con->translate(10,10); -$con->set_operator(OPERATOR_OVER); -$con->set_source($pat); +$con->setOperator(OPERATOR_OVER); +$con->setSource($pat); $con->rectangle(0,0,90,90); $con->fill(); -$sur->write_to_png("composite-integer-translate-over-repeat-php.png"); +$sur->writeToPng("composite-integer-translate-over-repeat-php.png"); ?> diff --git a/testcases/phpCairo/composite-integer-translate-over.php b/testcases/phpCairo/composite-integer-translate-over.php index ae5ab20..7bf91c4 100644 --- a/testcases/phpCairo/composite-integer-translate-over.php +++ b/testcases/phpCairo/composite-integer-translate-over.php @@ -3,17 +3,17 @@ $sur = new CairoImageSurface(FORMAT_ARGB32,100, 100); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32,1,1); -$s->create_from_png("romedalen.png"); +$s->createFromPng("romedalen.png"); -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->rectangle(0,0,100,100); $con->fill(); $con->translate(10,10); -$con->set_operator(OPERATOR_OVER); -$con->set_source_surface($s,0,0); +$con->setOperator(OPERATOR_OVER); +$con->setSourceSurface($s,0,0); $con->rectangle(0,0,90,90); $con->fill(); -$sur->write_to_png("composite-integer-translate-over-php.png"); +$sur->writeToPng("composite-integer-translate-over-php.png"); ?> diff --git a/testcases/phpCairo/composite-integer-translate-source-php.png b/testcases/phpCairo/composite-integer-translate-source-php.png index 34cf52d2de92b64e1c1988f94892f0c8bbd4e727..0c7edbb8c97d86c4f3ed4c7d224ba482f1663955 100644 GIT binary patch delta 21 ccwTF4U~Ft)oM6Wx!!K#xe?7^6quXwK07~=+UH||9 delta 21 ccwTF4U~Ft)oM6Yn&tbq}C1RJm(QUUq06_}|6aWAK diff --git a/testcases/phpCairo/composite-integer-translate-over.php b/testcases/phpCairo/composite-integer-translate-source.php similarity index 55% copy from testcases/phpCairo/composite-integer-translate-over.php copy to testcases/phpCairo/composite-integer-translate-source.php index ae5ab20..51b748a 100644 --- a/testcases/phpCairo/composite-integer-translate-over.php +++ b/testcases/phpCairo/composite-integer-translate-source.php @@ -3,17 +3,17 @@ $sur = new CairoImageSurface(FORMAT_ARGB32,100, 100); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32,1,1); -$s->create_from_png("romedalen.png"); +$s->createFromPng("romedalen.png"); -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->rectangle(0,0,100,100); $con->fill(); $con->translate(10,10); -$con->set_operator(OPERATOR_OVER); -$con->set_source_surface($s,0,0); +$con->setOperator(OPERATOR_SOURCE); +$con->setSourceSurface($s,0,0); $con->rectangle(0,0,90,90); $con->fill(); -$sur->write_to_png("composite-integer-translate-over-php.png"); +$sur->writeToPng("composite-integer-translate-source-php.png"); ?> diff --git a/testcases/phpCairo/create-from-png-php.png b/testcases/phpCairo/create-from-png-php.png index 72c6ccf997152ceadbf43925e164c2ada67c7192..34d8196121600735e7641b0db8bfe6bb33b3e8d9 100644 GIT binary patch delta 16 XcwQ?npJ2x!!!N}k<36Q%qMIQACSe4O delta 16 XcwQ?npJ2zqEi7g5C}*PVL^neKEAIs{ diff --git a/testcases/phpCairo/create-from-png-stream-php.png b/testcases/phpCairo/create-from-png-stream-php.png index 0c518c608e1bacc740618ba931caed3f08c971e6..0c41d6bfc45f5ea23ade227343e9d9a0ddfd53cc 100644 GIT binary patch delta 16 XcwQ?npJ2x!!!N~}qnp4p(ajJ5B|QWj delta 16 XcwQ?npJ2zqEvz8$XLbIXiEf4fF6RZ^ diff --git a/testcases/phpCairo/create-from-png-stream.php b/testcases/phpCairo/create-from-png-stream.php index cdd6c4c..023420e 100644 --- a/testcases/phpCairo/create-from-png-stream.php +++ b/testcases/phpCairo/create-from-png-stream.php @@ -3,9 +3,9 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 2, 2); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32, 2, 2); $file = fopen("create-from-png-ref.png","r"); -$s->create_from_png_stream($file); -$con->set_source_surface($s); +$s->createFromPngStream($file); +$con->setSourceSurface($s); $con->paint(); -$sur->write_to_png("create-from-png-stream-php.png"); +$sur->writeToPng("create-from-png-stream-php.png"); ?> diff --git a/testcases/phpCairo/create-from-png.php b/testcases/phpCairo/create-from-png.php index 082f413..bab8e23 100644 --- a/testcases/phpCairo/create-from-png.php +++ b/testcases/phpCairo/create-from-png.php @@ -3,9 +3,9 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 2, 2); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32, 2, 2); -$s->create_from_png("create-from-png-ref.png"); -$con->set_source_surface($s); +$s->createFromPng("create-from-png-ref.png"); +$con->setSourceSurface($s); $con->paint(); -$sur->write_to_png("create-from-png-php.png"); +$sur->writeToPng("create-from-png-php.png"); ?> diff --git a/testcases/phpCairo/dash-caps-joins-php.png b/testcases/phpCairo/dash-caps-joins-php.png index 5b734a168df581323c45548823ed864dd29318b6..674edc1cccdf8a2966a519dbce7bf25fedb21a41 100644 GIT binary patch delta 19 acwT#_@=j%f9fu6Rrnbujj?Ww2G=u;~msave(); -$con->set_source_rgb(1,1,1); -$con->paint(); -$con->restore(); - -for($i = 0; $i<2 ; $i++) { - $con->save(); - $con->set_line_width($linewidth); - $con->set_dash($dash, 2, $dashoff); - $con->translate($pad, $pad); - - $con->move_to(0,0); - $con->rel_line_to(0,$size); - $con->rel_line_to($size, 0); - $con->close_path(); - $con->move_to(2*$linewidth,0); - $con->rel_line_to(3*$linewidth, 0); - $con->rel_line_to(0,3*$linewidth); - - $con->set_line_cap(LINE_CAP_BUTT); - $con->set_line_join(LINE_JOIN_BEVEL); - $con->stroke(); - - $con->translate($size+$pad, 0); - - $con->move_to(0,0); - $con->rel_line_to(0,$size); - $con->rel_line_to($size, 0); - $con->close_path(); - $con->move_to(2*$linewidth,0); - $con->rel_line_to(3*$linewidth, 0); - $con->rel_line_to(0,3*$linewidth); - - $con->set_line_cap(LINE_CAP_ROUND); - $con->set_line_join(LINE_JOIN_ROUND); - $con->stroke(); - $con->translate($size+$pad, 0); - - $con->move_to(0,0); - $con->rel_line_to(0,$size); - $con->rel_line_to($size, 0); - $con->close_path(); - $con->move_to(2*$linewidth,0); - $con->rel_line_to(3*$linewidth, 0); - $con->rel_line_to(0,3*$linewidth); - - $con->set_line_cap(LINE_CAP_SQUARE); - $con->set_line_join(LINE_JOIN_MITER); - $con->stroke(); - /* $con->translate($size+$pad, 0); - - $con->move_to(0,0); - $con->rel_line_to(0,$size); - $con->rel_line_to($size, 0); - $con->close_path(); - $con->move_to(2*$linewidth,0); - $con->rel_line_to(3*$linewidth, 0); - $con->rel_line_to(0,3*$linewidth); -*/ - $con->restore(); - $con->translate(0,$size+$pad); - $dashoff = 0; - } - $sur->write_to_png("dash-caps-joins-php.png"); -?> - - +save(); +$con->setSourceRgb(1,1,1); +$con->paint(); +$con->restore(); + +for($i = 0; $i<2 ; $i++) { + $con->save(); + $con->setLineWidth($linewidth); + $con->setDash($dash, 2, $dashoff); + $con->translate($pad, $pad); + + $con->moveTo(0,0); + $con->relLineTo(0,$size); + $con->relLineTo($size, 0); + $con->closePath(); + $con->moveTo(2*$linewidth,0); + $con->relLineTo(3*$linewidth, 0); + $con->relLineTo(0,3*$linewidth); + + $con->setLineCap(LINE_CAP_BUTT); + $con->setLineJoin(LINE_JOIN_BEVEL); + $con->stroke(); + + $con->translate($size+$pad, 0); + + $con->moveTo(0,0); + $con->relLineTo(0,$size); + $con->relLineTo($size, 0); + $con->closePath(); + $con->moveTo(2*$linewidth,0); + $con->relLineTo(3*$linewidth, 0); + $con->relLineTo(0,3*$linewidth); + + $con->setLineCap(LINE_CAP_ROUND); + $con->setLineJoin(LINE_JOIN_ROUND); + $con->stroke(); + $con->translate($size+$pad, 0); + + $con->moveTo(0,0); + $con->relLineTo(0,$size); + $con->relLineTo($size, 0); + $con->closePath(); + $con->moveTo(2*$linewidth,0); + $con->relLineTo(3*$linewidth, 0); + $con->relLineTo(0,3*$linewidth); + + $con->setLineCap(LINE_CAP_SQUARE); + $con->setLineJoin(LINE_JOIN_MITER); + $con->stroke(); + $con->restore(); + $con->translate(0,$size+$pad); + $dashoff = 0; + } + $sur->writeToPng("dash-caps-joins-php.png"); +?> + + diff --git a/testcases/phpCairo/dash-curve-php.png b/testcases/phpCairo/dash-curve-php.png index 7e6e6ebf11dd6ddb5b166e363916b4bf30262567..82c11578101fb74da02f027be698aa60a520e572 100644 GIT binary patch delta 21 dcwSq4jA`*PrU`Z&GW?om>eEuRHoDzi1OQd-2lxO0 delta 21 dcwSq4jA`*PrU`Z&Jesave(); -$dash = array(20.0,20.0); - -$con->set_source_rgb(0, 0, 0); -$con->paint(); - -for($a=0; $a<4; $a++) -for($b=0; $b<5; $b++) -for($c=0; $c<5; $c++) { - - $con->move_to((($b*5)+$c)*60 + 10, $a*60 + 10); - $con->rel_curve_to(0, $b*10, 0, $b*10, $c*10, $b*10); - $con->set_source_rgb(1,1,1); - $con->set_line_width(8); - $con->set_line_cap(LINE_CAP_ROUND); - $con->set_dash($dash, 2, $a*10); - $con->stroke_preserve(); - $con->set_source_rgb(0,0.5,1); - //$con->restore(); - //$con->set_source_rgb(1,1,1); - $con->set_line_width(2); - $con->set_line_cap(2); - $ar = array(8.0,8.0); - $con->set_dash($ar,2,0); - $con->stroke(); -} - -$sur->write_to_png("dash-curve-php.png"); -?> - +save(); +$dash = array(20.0,20.0); + +$con->setSourceRgb(0, 0, 0); +$con->paint(); + +for($a=0; $a<4; $a++) +for($b=0; $b<5; $b++) +for($c=0; $c<5; $c++) { + + $con->moveTo((($b*5)+$c)*60 + 10, $a*60 + 10); + $con->relCurveTo(0, $b*10, 0, $b*10, $c*10, $b*10); + $con->setSourceRgb(1,1,1); + $con->setLineWidth(8); + $con->setLineCap(LINE_CAP_ROUND); + $con->setDash($dash, 2, $a*10); + $con->strokePreserve(); + $con->setSourceRgb(0,0.5,1); + $con->setLineWidth(2); + $con->setLineCap(2); + $ar = array(8.0,8.0); + $con->setDash($ar,2,0); + $con->stroke(); +} + +$sur->writeToPng("dash-curve-php.png"); +?> + diff --git a/testcases/phpCairo/dash-scale-php.png b/testcases/phpCairo/dash-scale-php.png index ea86b63345fb68d2d10b10be8ba10a3071be976c..e579c1e5dabfa6d90c27233e1929c488d911f61e 100644 GIT binary patch delta 19 bcwT#A`^0vF9fu6Rmh1xdb1OHx&65KFOIZh8 delta 19 bcwT#A`^0vF9S4uF7{k}=*H|{X&65KFPDcl) diff --git a/testcases/phpCairo/dash-scale.php b/testcases/phpCairo/dash-scale.php dissimilarity index 74% index ef3e948..75af3b3 100644 --- a/testcases/phpCairo/dash-scale.php +++ b/testcases/phpCairo/dash-scale.php @@ -1,150 +1,150 @@ -save(); -$con->set_source_rgb(1,1,1); -$con->paint(); -$con->restore(); - -$con->translate($pad, $pad); - -$con->set_dash($dash, 1, -2*$linewidth); -$con->set_line_width($linewidth); - -$con->save(); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); - -$con->set_line_cap(LINE_CAP_BUTT); -$con->set_line_join(LINE_JOIN_BEVEL); -$con->stroke(); -$con->translate($size+$pad,0); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); - -$con->set_line_cap(LINE_CAP_ROUND); -$con->set_line_join(LINE_JOIN_ROUND); -$con->stroke(); -$con->translate($size+$pad, 0); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); - -$con->set_line_cap(LINE_CAP_SQUARE); -$con->set_line_join(LINE_JOIN_MITER); -$con->stroke(); -$con->restore(); - -$con->translate(0, $size + 2*$pad); -//$con->save(); - -$con->save(); -$con->scale(1,2); -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); - -$con->set_line_cap(LINE_CAP_BUTT); -$con->set_line_join(LINE_JOIN_BEVEL); -$con->stroke(); -$con->translate($size+$pad, 0); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); - -$con->set_line_cap(LINE_CAP_ROUND); -$con->set_line_join(LINE_JOIN_ROUND); -$con->stroke(); -$con->translate($size+$pad, 0); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); - -$con->set_line_cap(LINE_CAP_SQUARE); -$con->set_line_join(LINE_JOIN_MITER); -$con->stroke(); -$con->restore(); - -$con->translate(0, 2*$size + 2*$pad); -$con->save(); -$con->scale(1,2); -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); - -$con->set_line_cap(LINE_CAP_BUTT); -$con->set_line_join(LINE_JOIN_BEVEL); -$con->stroke(); -$con->translate($size+$pad, 0); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); - -$con->set_line_cap(LINE_CAP_ROUND); -$con->set_line_join(LINE_JOIN_ROUND); -$con->stroke(); -$con->translate($size+$pad, 0); - -$con->move_to(0,0); -$con->rel_line_to(0,$size); -$con->rel_line_to($size,0); -$con->close_path(); -$con->move_to(2*$linewidth, 0); -$con->rel_line_to(3*$linewidth, 0); -$con->rel_line_to(0, 3 * $linewidth); -$con->set_line_cap(LINE_CAP_SQUARE); -$con->set_line_join(LINE_JOIN_MITER); -$con->stroke(); -$con->restore(); - -$sur->write_to_png("dash-scale-php.png"); -?> +save(); +$con->setSourceRgb(1,1,1); +$con->paint(); +$con->restore(); + +$con->translate($pad, $pad); + +$con->setDash($dash, 1, -2*$linewidth); +$con->setLineWidth($linewidth); + +$con->save(); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); + +$con->setLineCap(LINE_CAP_BUTT); +$con->setLineJoin(LINE_JOIN_BEVEL); +$con->stroke(); +$con->translate($size+$pad,0); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); + +$con->setLineCap(LINE_CAP_ROUND); +$con->setLineJoin(LINE_JOIN_ROUND); +$con->stroke(); +$con->translate($size+$pad, 0); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); + +$con->setLineCap(LINE_CAP_SQUARE); +$con->setLineJoin(LINE_JOIN_MITER); +$con->stroke(); +$con->restore(); + +$con->translate(0, $size + 2*$pad); +//$con->save(); + +$con->save(); +$con->scale(1,2); +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); + +$con->setLineCap(LINE_CAP_BUTT); +$con->setLineJoin(LINE_JOIN_BEVEL); +$con->stroke(); +$con->translate($size+$pad, 0); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); + +$con->setLineCap(LINE_CAP_ROUND); +$con->setLineJoin(LINE_JOIN_ROUND); +$con->stroke(); +$con->translate($size+$pad, 0); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); + +$con->setLineCap(LINE_CAP_SQUARE); +$con->setLineJoin(LINE_JOIN_MITER); +$con->stroke(); +$con->restore(); + +$con->translate(0, 2*$size + 2*$pad); +$con->save(); +$con->scale(1,2); +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); + +$con->setLineCap(LINE_CAP_BUTT); +$con->setLineJoin(LINE_JOIN_BEVEL); +$con->stroke(); +$con->translate($size+$pad, 0); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); + +$con->setLineCap(LINE_CAP_ROUND); +$con->setLineJoin(LINE_JOIN_ROUND); +$con->stroke(); +$con->translate($size+$pad, 0); + +$con->moveTo(0,0); +$con->relLineTo(0,$size); +$con->relLineTo($size,0); +$con->closePath(); +$con->moveTo(2*$linewidth, 0); +$con->relLineTo(3*$linewidth, 0); +$con->relLineTo(0, 3 * $linewidth); +$con->setLineCap(LINE_CAP_SQUARE); +$con->setLineJoin(LINE_JOIN_MITER); +$con->stroke(); +$con->restore(); + +$sur->writeToPng("dash-scale-php.png"); +?> diff --git a/testcases/phpCairo/dashes.php b/testcases/phpCairo/dashes.php index c333e41..93831fa 100644 --- a/testcases/phpCairo/dashes.php +++ b/testcases/phpCairo/dashes.php @@ -8,12 +8,12 @@ $ndash = count($dashes); $offset = -50.0; $sur = new CairoImageSurface(0,500,500); $con = new CairoContext($sur); -$con->set_dash ($dashes, $ndash, $offset); -$con->set_line_width (10.0); -$con->move_to (128.0, 25.6); -$con->line_to ( 230.4, 230.4); -$con->rel_line_to ( -102.4, 0.0); -$con->curve_to ( 51.2, 230.4, 51.2, 128.0, 128.0, 128.0); +$con->setDash ($dashes, $ndash, $offset); +$con->setLineWidth (10.0); +$con->moveTo (128.0, 25.6); +$con->lineTo ( 230.4, 230.4); +$con->relLineTo ( -102.4, 0.0); +$con->curveTo ( 51.2, 230.4, 51.2, 128.0, 128.0, 128.0); $con->stroke (); -$sur->write_to_png("image_dash.png"); +$sur->writeToPng("image_dash.png"); ?> diff --git a/testcases/phpCairo/degenerate-arc-php.png b/testcases/phpCairo/degenerate-arc-php.png index c13634df2f2ca4c25412a0d9b83a896327a0f8f7..c7c16a91694a093c8d516a6ea41cc9f030061248 100644 GIT binary patch delta 19 acwT$W@|tCW9fu6RmUjN$XoHPzs!RYvmIev{ delta 19 acwT$W@|tCW9S4uFysW!0set_source_rgb(1,1,1); +$con->setSourceRgb(1,1,1); $con->paint(); -$con->set_line_cap(LINE_CAP_ROUND); -$con->set_line_width(5); +$con->setLineCap(LINE_CAP_ROUND); +$con->setLineWidth(5); -$con->set_source_rgb(0,1,0); +$con->setSourceRgb(0,1,0); for($n=0;$n<8;$n++) { $theta = $n * 2 * M_PI / 8; - $con->new_sub_path(); + $con->newSubPath(); $con->arc(20, 20, 15, $theta, $theta); - $con->close_path(); + $con->closePath(); } $con->stroke(); -$con->set_line_width(2); -$con->set_source_rgb(0,0,1); +$con->setLineWidth(2); +$con->setSourceRgb(0,0,1); for($n=0;$n<8;$n++) { $theta = $n * 2 * M_PI / 8; - $con->move_to(20,20); + $con->moveTo(20,20); $con->arc(20,20,15, $theta, $theta); - $con->close_path(); + $con->closePath(); } $con->stroke(); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); $con->arc(20,20,2,0,2*M_PI); $con->fill(); -$sur->write_to_png("degenerate-arc-php.png"); +$sur->writeToPng("degenerate-arc-php.png"); ?> diff --git a/testcases/phpCairo/degenerate-path-php.png b/testcases/phpCairo/degenerate-path-php.png index e261d569843e564ed798c3b0c6a832cd608f3b6c..315b0e135e8f738f6e13702720582668b1222040 100644 GIT binary patch delta 18 ZcwTE{YGj&V$05V7Wn6RdaN0z--2gIS25kTU delta 18 ZcwTE{YGj&V$HC7j%I-XCrp`pS-2f`)1w{Y= diff --git a/testcases/phpCairo/degenerate-path.php b/testcases/phpCairo/degenerate-path.php index 21d001f..66ffb62 100644 --- a/testcases/phpCairo/degenerate-path.php +++ b/testcases/phpCairo/degenerate-path.php @@ -8,74 +8,74 @@ $con = new CairoContext($sur); $dash = array(2.0, 2.0); $dash_long = array(6.0, 6.0); - $con->set_source_rgb ( 1, 0, 0); + $con->setSourceRgb ( 1, 0, 0); for ($i=0; $i<3; $i++) { $con->save (); - $con->set_line_cap ( $cap[$i]); + $con->setLineCap ( $cap[$i]); /* simple degenerate paths */ - $con->set_line_width ( 6); - $con->move_to ( 6, 6); - $con->line_to ( 6, 6); + $con->setLineWidth ( 6); + $con->moveTo ( 6, 6); + $con->lineTo ( 6, 6); $con->stroke (); $con->translate ( 0, 3*3); - $con->move_to ( 6, 6); - $con->close_path (); + $con->moveTo ( 6, 6); + $con->closePath (); $con->stroke (); /* degenerate paths starting with dash on */ - $con->set_dash ( $dash, 2, 0.); + $con->setDash ( $dash, 2, 0.); $con->translate ( 0, 3*3); - $con->move_to ( 6, 6); - $con->line_to ( 6, 6); + $con->moveTo ( 6, 6); + $con->lineTo ( 6, 6); $con->stroke (); $con->translate ( 0, 3*3); - $con->move_to ( 6, 6); - $con->close_path (); + $con->moveTo ( 6, 6); + $con->closePath (); $con->stroke (); /* degenerate paths starting with dash off */ /* these should not draw anything */ - $con->set_dash ( $dash, 2, 2.); + $con->setDash ( $dash, 2, 2.); $con->translate ( 0, 3*3); - $con->move_to ( 6, 6); - $con->line_to ( 6, 6); + $con->moveTo ( 6, 6); + $con->lineTo ( 6, 6); $con->stroke (); $con->translate ( 0, 3*3); - $con->move_to ( 6, 6); - $con->close_path (); + $con->moveTo ( 6, 6); + $con->closePath (); $con->stroke (); /* this should draw a single degenerate sub-path * at the end of the path */ - $con->set_dash ( $dash_long, 2, 6.); + $con->setDash ( $dash_long, 2, 6.); $con->translate ( 0, 3*3); - $con->move_to ( 6 + 6.0, 6); - $con->line_to ( 6, 6); + $con->moveTo ( 6 + 6.0, 6); + $con->lineTo ( 6, 6); $con->stroke (); /* this should draw a single degenerate sub-path * at the end of the path. The difference between this * and the above is that this ends with a degenerate sub-path*/ - $con->set_dash ( $dash_long, 2, 6.); + $con->setDash ( $dash_long, 2, 6.); $con->translate ( 0, 3*3); - $con->move_to ( 6 + 6.0, 6); - $con->line_to ( 6, 6); - $con->line_to ( 6, 6); + $con->moveTo ( 6 + 6.0, 6); + $con->lineTo ( 6, 6); + $con->lineTo ( 6, 6); $con->stroke (); $con->restore (); $con->translate ( 3+6+3, 0); } -$sur->write_to_png("degenerate-path-php.png"); +$sur->writeToPng("degenerate-path-php.png"); ?> diff --git a/testcases/phpCairo/degenerate-pen-php.png b/testcases/phpCairo/degenerate-pen-php.png index abc8f5ca14fed442a0fb433ced9de11767acdbc8..450b377a8cbd150b3951c75e3c9c0dabe517acb2 100644 GIT binary patch delta 19 acwXDVv4dlR9fu6RmK7^+^`VV!pO^tTjs_tB delta 19 acwXDVv4dlR9S1+R8f#RwXWT}&Ps{*0O9li0 diff --git a/testcases/phpCairo/degenerate-pen.php b/testcases/phpCairo/degenerate-pen.php index e36c1f3..0755cd4 100644 --- a/testcases/phpCairo/degenerate-pen.php +++ b/testcases/phpCairo/degenerate-pen.php @@ -1,19 +1,18 @@ move_to(0,0); +$con->moveTo(0,0); - $con->set_source_rgb ( 1, 1, 1); + $con->setSourceRgb ( 1, 1, 1); $con->paint (); - $con->set_source_rgb ( 0, 0, 0); -// $con->set_line_join (LINE_JOIN_ROUND); -$con->move_to(0,0); + $con->setSourceRgb ( 0, 0, 0); + $con->moveTo(0,0); $con->translate ( 5, 5); /* First compress the pen to a vertical line. */ $con->rectangle ( 0, 0, 20, 20); - $con->curve_to ( 20 / 2, 0, 20, 20 / 2, 20, 20); + $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20); $con->save (); { $con->scale ( 0.00001, 1.0); @@ -25,7 +24,7 @@ $con->move_to(0,0); /* Then compress the pen to a horizontal line. */ $con->rectangle ( 0, 0, 20, 20); - $con->curve_to ( 20 / 2, 0, 20, 20 / 2, 20, 20); + $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20); $con->save (); { $con->scale ( 1.0, 0.00001); @@ -37,7 +36,7 @@ $con->move_to(0,0); /* Finally a line at an angle. */ $con->rectangle ( 0, 0, 20, 20); - $con->curve_to ( 20 / 2, 0, 20, 20 / 2, 20, 20); + $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20); $con->save (); { $con->rotate ( M_PI / 4.0); @@ -45,17 +44,17 @@ $con->move_to(0,0); $con->stroke (); } $con->restore (); -$con->set_source_rgb ( 1, 1, 1); +$con->setSourceRgb ( 1, 1, 1); $con->paint (); - $con->set_source_rgb ( 0, 0, 0); - $con->set_line_join (LINE_JOIN_ROUND); + $con->setSourceRgb ( 0, 0, 0); + $con->setLineJoin (LINE_JOIN_ROUND); $con->translate ( 5, 5); /* First compress the pen to a vertical line. */ $con->rectangle ( 0, 0, 20, 20); - $con->curve_to ( 20 / 2, 0, 20, 20 / 2, 20, 20); + $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20); $con->save (); { $con->scale ( 0.00001, 1.0); @@ -67,7 +66,7 @@ $con->set_source_rgb ( 1, 1, 1); /* Then compress the pen to a horizontal line. */ $con->rectangle ( 0, 0, 20, 20); - $con->curve_to ( 20 / 2, 0, 20, 20 / 2, 20, 20); + $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20); $con->save (); { $con->scale ( 1.0, 0.00001); @@ -79,7 +78,7 @@ $con->set_source_rgb ( 1, 1, 1); /* Finally a line at an angle. */ $con->rectangle ( 0, 0, 20, 20); - $con->curve_to ( 20 / 2, 0, 20, 20 / 2, 20, 20); + $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20); $con->save (); { $con->rotate ( M_PI / 4.0); @@ -87,5 +86,5 @@ $con->set_source_rgb ( 1, 1, 1); $con->stroke (); } $con->restore (); - $sur->write_to_png("degenerate-pen-php.png"); + $sur->writeToPng("degenerate-pen-php.png"); ?> diff --git a/testcases/phpCairo/device-offset-php.png b/testcases/phpCairo/device-offset-php.png index f3dec07a287874dfcbff36e4b5cf75802718a537..cde1ee452904f13d3abf15e9cff57668c50c8bee 100644 GIT binary patch delta 18 ZcwXyd>|~r^$05V7&2qOqTw|h}GXO5(1u_5t delta 18 ZcwXyd>|~r^$H60Pq`ji~+@pzZ&Hyvu23!CD diff --git a/testcases/phpCairo/device-offset-positive-php.png b/testcases/phpCairo/device-offset-positive-php.png index b01648bc1a49927cd68ec011d8d9ba2eb058cfb4..f957f24b2113c46a34cf482de70a77e75e615c24 100644 GIT binary patch delta 18 ZcwXyf>}H%`$05V7&AIrP_SA`Pt^hD=1(N^( delta 18 ZcwXyf>}H%`$H614tJ!^hVZcN;R{$~X1=9ck diff --git a/testcases/phpCairo/device-offset-positive.php b/testcases/phpCairo/device-offset-positive.php index f83a4e6..206c6d4 100644 --- a/testcases/phpCairo/device-offset-positive.php +++ b/testcases/phpCairo/device-offset-positive.php @@ -4,23 +4,23 @@ $pad = 2; $sur = new CairoImageSurface(FORMAT_ARGB32, $size, $size); $con = new CairoContext($sur); -$con->set_source_rgb(0,0,1); +$con->setSourceRgb(0,0,1); $con->rectangle($pad, $pad, $size - 2*$pad, $size - 2*$pad); $con->fill(); -$s = $con->get_group_target(); -$c = $s->get_content(); -$s1 = $s->create_similar($c, $size/2, $size/2); +$s = $con->getGroupTarget(); +$c = $s->getContent(); +$s1 = $s->createSimilar($c, $size/2, $size/2); $c = new CairoContext($s1); -$c->set_source_rgb(1,0,0); +$c->setSourceRgb(1,0,0); $c->rectangle($pad, $pad, $size - 2*$pad, $size - 2*$pad); $c->fill(); -$s1->set_device_offset($size/2, $size/2); -$con->set_source_surface($s1, $size/2, $size/2); +$s1->setDeviceOffset($size/2, $size/2); +$con->setSourceSurface($s1, $size/2, $size/2); $con->paint(); -$sur->write_to_png("device-offset-positive-php.png"); +$sur->writeToPng("device-offset-positive-php.png"); ?> diff --git a/testcases/phpCairo/device-offset-positive.php b/testcases/phpCairo/device-offset.php similarity index 50% copy from testcases/phpCairo/device-offset-positive.php copy to testcases/phpCairo/device-offset.php index f83a4e6..b635d91 100644 --- a/testcases/phpCairo/device-offset-positive.php +++ b/testcases/phpCairo/device-offset.php @@ -4,23 +4,24 @@ $pad = 2; $sur = new CairoImageSurface(FORMAT_ARGB32, $size, $size); $con = new CairoContext($sur); -$con->set_source_rgb(0,0,1); +$con->setSourceRgb(0,0,1); $con->rectangle($pad, $pad, $size - 2*$pad, $size - 2*$pad); $con->fill(); -$s = $con->get_group_target(); -$c = $s->get_content(); -$s1 = $s->create_similar($c, $size/2, $size/2); +$s = $con->getGroupTarget(); +$c = $s->getContent(); +$s1 = $s->createSimilar($c, $size/2, $size/2); + +$s1->setDeviceOffset($size/-2, $size/-2); $c = new CairoContext($s1); -$c->set_source_rgb(1,0,0); +$c->setSourceRgb(1,0,0); $c->rectangle($pad, $pad, $size - 2*$pad, $size - 2*$pad); $c->fill(); -$s1->set_device_offset($size/2, $size/2); -$con->set_source_surface($s1, $size/2, $size/2); +$con->setSourceSurface($s1, 0, 0); $con->paint(); -$sur->write_to_png("device-offset-positive-php.png"); +$sur->writeToPng("device-offset-php.png"); ?> diff --git a/testcases/phpCairo/extend-pad.php b/testcases/phpCairo/extend-pad.php index 1dda114..6f9edc5 100644 --- a/testcases/phpCairo/extend-pad.php +++ b/testcases/phpCairo/extend-pad.php @@ -3,45 +3,44 @@ $con = new CairoContext($sur); $surface_size = (90 - 30) / 10; - $con->set_source_rgba ( 0, 0, 0, 1); + $con->setSourceRgba ( 0, 0, 0, 1); $con->rectangle ( 0, 0, 90, 90); $con->fill (); $surface = new CairoImageSurface(FORMAT_RGB24, $surface_size, $surface_size); $con2 = new CairoContext($surface); - $con2->set_source_rgb ( 1, 1, 1); + $con2->setSourceRgb ( 1, 1, 1); $con2->rectangle ( 0, 0, $surface_size / 2, $surface_size / 2); $con2->fill (); - $con2->set_source_rgb ( 1, 0, 0); + $con2->setSourceRgb ( 1, 0, 0); $con2->rectangle ( $surface_size / 2, 0, $surface_size / 2, $surface_size / 2); $con2->fill (); - $con2->set_source_rgb ( 0, 1, 0); + $con2->setSourceRgb ( 0, 1, 0); $con2->rectangle ( 0, $surface_size / 2, $surface_size / 2, $surface_size / 2); $con2->fill (); - $con2->set_source_rgb ( 0, 0, 1); + $con2->setSourceRgb ( 0, 0, 1); $con2->rectangle ( $surface_size / 2, $surface_size / 2, $surface_size / 2, $surface_size / 2); $con2->fill (); $con->scale ( 10, 10); - $con->set_source_surface ( $surface, 1.5, 1.5); + $con->setSourceSurface ( $surface, 1.5, 1.5); /* Using EXTEND_REFLECT makes this test pass for image and xlib backends */ - /*$con2->pattern_set_extend ($con2->get_source (), EXTEND_REFLECT);*/ - $pattern = $con->get_source(); - $pattern->set_extend(EXTEND_PAD); + $pattern = $con->getSource(); + $pattern->setExtend(EXTEND_PAD); $con->rectangle ( 1.5, 1.5, 6, 6); $con->clip (); - $con->set_source($pattern); + $con->setSource($pattern); $con->paint (); - $sur->write_to_png("extend-pad-php.png"); + $sur->writeToPng("extend-pad-php.png"); diff --git a/testcases/phpCairo/extend-reflect.php b/testcases/phpCairo/extend-reflect.php index f5ad338..1759c82 100644 --- a/testcases/phpCairo/extend-reflect.php +++ b/testcases/phpCairo/extend-reflect.php @@ -3,13 +3,13 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 256 + 32*2, 192 + 32*2); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32,1,1); -$s->create_from_png("romedalen.png"); +$s->createFromPng("romedalen.png"); -$con->set_source_surface($s,32,32); +$con->setSourceSurface($s,32,32); -$pat = $con->get_source(); -$pat->set_extend(EXTEND_REFLECT); +$pat = $con->getSource(); +$pat->setExtend(EXTEND_REFLECT); $con->paint(); -$sur->write_to_png("extend-reflect-php.png"); +$sur->writeToPng("extend-reflect-php.png"); ?> diff --git a/testcases/phpCairo/extend-repeat-similar.php b/testcases/phpCairo/extend-repeat-similar.php dissimilarity index 60% index 1adcc09..ed418b0 100644 --- a/testcases/phpCairo/extend-repeat-similar.php +++ b/testcases/phpCairo/extend-repeat-similar.php @@ -1,21 +1,18 @@ -create_from_png("romedalen.png"); -//$s1 = new CairoImageSurface(FORMAT_ARGB32,100, 100); -$s1 = $sur->create_similar($sur->get_content(), 320, 256); -$con2 = new CairoContext($s1); -$con2->set_source_surface($s, 32 ,32); -$con2->set_operator(OPERATOR_SOURCE); -$pat = $con2->get_source(); -$pat->set_extend(EXTEND_REPEAT); -$con2->paint(); -$con->set_source_surface($s1, 0, 0); -//$pat = $con->get_source(); -//$pat->set_extend(EXTEND_REPEAT); -//$con->set_source($pat); -$con->paint(); -$sur->write_to_png("extend-repeat-similar-php.png"); -?> - +createFromPng("romedalen.png"); +//$s1 = new CairoImageSurface(FORMAT_ARGB32,100, 100); +$s1 = $sur->createSimilar($sur->get_content(), 320, 256); +$con2 = new CairoContext($s1); +$con2->setSourceSurface($s, 32 ,32); +$con2->setPperator(OPERATOR_SOURCE); +$pat = $con2->getSource(); +$pat->setExtend(EXTEND_REPEAT); +$con2->paint(); +$con->setSourceSurface($s1, 0, 0); +$con->paint(); +$sur->writeToPng("extend-repeat-similar-php.png"); +?> + diff --git a/testcases/phpCairo/extend-repeat.php b/testcases/phpCairo/extend-repeat.php index 10f8347..71ae40e 100644 --- a/testcases/phpCairo/extend-repeat.php +++ b/testcases/phpCairo/extend-repeat.php @@ -2,13 +2,13 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 256 + 32*2, 192+ 32*2); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32,100, 100); -$s->create_from_png("romedalen.png"); -$con->set_source_surface($s,32,32); -$pat = $con->get_source(); -$pat->set_extend(EXTEND_REPEAT); -$con->set_source($pat); +$s->createFromPng("romedalen.png"); +$con->setSourceSurface($s,32,32); +$pat = $con->getSource(); +$pat->setExtend(EXTEND_REPEAT); +$con->setSource($pat); $con->paint(); -$sur->write_to_png("extend-repeat-php.png"); +$sur->writeToPng("extend-repeat-php.png"); ?> diff --git a/testcases/phpCairo/fill-and-stroke-php.png b/testcases/phpCairo/fill-and-stroke-php.png index 71272747f6e303fa70f283376106646c5bbea174..a91b4b04ce1f160c359f344f7f9004c4997e14a2 100644 GIT binary patch delta 18 acwU>%G@WUJ9fu6Rso1Z6$^8@EE&>2F)&__G delta 18 ZcwU>%G@WUJ9S6U#6t8KTSM)@;ivTP@1v&r# diff --git a/testcases/phpCairo/fill-and-stroke.php b/testcases/phpCairo/fill-and-stroke.php index 78ddbbb..45041d3 100644 --- a/testcases/phpCairo/fill-and-stroke.php +++ b/testcases/phpCairo/fill-and-stroke.php @@ -2,17 +2,17 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 28, 14); $con = new CairoContext($sur); $con->rectangle(2,2,10,10); -$con->set_source_rgb(0,0,1); -$con->fill_preserve(); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(0,0,1); +$con->fillPreserve(); +$con->setSourceRgb(1,0,0); $con->stroke(); $con->translate(14,0); $con->arc(7, 7, 5, 0, 2*M_PI); -$con->fill_preserve(); -$con->set_source_rgb(0,0,1); +$con->fillPreserve(); +$con->setSourceRgb(0,0,1); $con->stroke(); -$sur->write_to_png("fill-and-stroke-php.png"); +$sur->writeToPng("fill-and-stroke-php.png"); ?> diff --git a/testcases/phpCairo/fill-degenerate-sort-order-php.png b/testcases/phpCairo/fill-degenerate-sort-order-php.png index 67f27b02debf6eeb405e23d8db799f34e02ec460..19a8eb2397d3aa149f33c5190a3711a36f89ed9b 100644 GIT binary patch delta 19 acwW0JbXRDC9fu6RscdfS0rQP+;+z0NCI$)s delta 19 bcwW0JbXRDC9S6U#yxf`f{|{_*6Xyf~Nset_source_rgb(1,0,0); -$con->move_to(43,103); -$con->line_to(91,101); -$con->line_to(0,112); -$con->line_to(60,0); -$con->line_to(91,101); -$con->line_to(43,103); -$con->line_to(176,110); -$con->line_to(116,100); -$con->line_to(176,0); -$con->line_to(176,110); -$con->close_path(); -$con->fill(); -$sur->write_to_png("fill-degenerate-sort-order-php.png"); -?> - +setSourceRgb(1,0,0); +$con->moveTo(43,103); +$con->lineTo(91,101); +$con->lineTo(0,112); +$con->lineTo(60,0); +$con->lineTo(91,101); +$con->lineTo(43,103); +$con->lineTo(176,110); +$con->lineTo(116,100); +$con->lineTo(176,0); +$con->lineTo(176,110); +$con->closePath(); +$con->fill(); +$sur->writeToPng("fill-degenerate-sort-order-php.png"); +?> + diff --git a/testcases/phpCairo/fill-missed-stop-php.png b/testcases/phpCairo/fill-missed-stop-php.png index b8fb509f70867992cdf23bc849569d7814a23d4e..f58a2276e402f8d52e894276c6e10a6fb98140de 100644 GIT binary patch delta 19 acwW22e2IC29fu6RsftmAhy6yk9!3B=8U>mF delta 19 acwW22e2IC29S6U#lA?g(Ea#1GJ&XW3Km~XJ diff --git a/testcases/phpCairo/fill-missed-stop.php b/testcases/phpCairo/fill-missed-stop.php index 33737af..f07b621 100644 --- a/testcases/phpCairo/fill-missed-stop.php +++ b/testcases/phpCairo/fill-missed-stop.php @@ -2,15 +2,15 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 53, 53); $con = new CairoContext($sur); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); $con->translate(1,1); -$con->move_to(0,0); -$con->line_to(25,50); -$con->line_to(25,0); -$con->line_to(50,25); -$con->line_to(0,25); -$con->close_path(); +$con->moveTo(0,0); +$con->lineTo(25,50); +$con->lineTo(25,0); +$con->lineTo(50,25); +$con->lineTo(0,25); +$con->closePath(); $con->fill(); -$sur->write_to_png("fill-missed-stop-php.png"); +$sur->writeToPng("fill-missed-stop-php.png"); ?> diff --git a/testcases/phpCairo/fill-rule.php b/testcases/phpCairo/fill-rule.php index b7bdc84..b7722db 100644 --- a/testcases/phpCairo/fill-rule.php +++ b/testcases/phpCairo/fill-rule.php @@ -2,44 +2,44 @@ function little_star_path() { global $con; - $con->move_to(10,0); - $con->rel_line_to(6,20); - $con->rel_line_to(-16,-12); - $con->rel_line_to(20,0); - $con->rel_line_to(-16,12); + $con->moveTo(10,0); + $con->relLineTo(6,20); + $con->relLineTo(-16,-12); + $con->relLineTo(20,0); + $con->relLineTo(-16,12); } function big_star_path() { global $con; - $con->move_to(40,0); - $con->rel_line_to(25,80); - $con->rel_line_to(-65,-50); - $con->rel_line_to(80,0); - $con->rel_line_to(-65,50); - $con->close_path(); + $con->moveTo(40,0); + $con->relLineTo(25,80); + $con->relLineTo(-65,-50); + $con->relLineTo(80,0); + $con->relLineTo(-65,50); + $con->closePath(); } $sur = new CairoImageSurface(FORMAT_ARGB32, 163, 103); $con = new CairoContext($sur); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); $con->translate(1,1); little_star_path(); -$con->set_fill_rule(FILL_RULE_WINDING); +$con->setFillRule(FILL_RULE_WINDING); $con->fill(); $con->translate(21,0); little_star_path(); -$con->set_fill_rule(FILL_RULE_EVEN_ODD); +$con->setFillRule(FILL_RULE_EVEN_ODD); $con->fill(); $con->translate(-21, 21); big_star_path(); -$con->set_fill_rule(FILL_RULE_WINDING); +$con->setFillRule(FILL_RULE_WINDING); $con->fill(); $con->translate(81,0); big_star_path(); -$con->set_fill_rule(FILL_RULE_EVEN_ODD); +$con->setFillRule(FILL_RULE_EVEN_ODD); $con->fill(); -$sur->write_to_png("fill-rule-php.png"); +$sur->writeToPng("fill-rule-php.png"); ?> diff --git a/testcases/phpCairo/filter-bilinear-extents-php.png b/testcases/phpCairo/filter-bilinear-extents-php.png index 705f7bd49f6aaa0997937d004e83d4e616c9df0c..1799e4f53edf6e8dad7625424e9049092953b949 100644 GIT binary patch delta 19 acwXDcwvlau9fu6Rsix0MlctSsubBWnW(J)A delta 19 bcwXDcwvlau9S6S%1Czk+-BUKYy=DRcIr0W* diff --git a/testcases/phpCairo/filter-bilinear-extents.php b/testcases/phpCairo/filter-bilinear-extents.php index 6765b41..e870235 100644 --- a/testcases/phpCairo/filter-bilinear-extents.php +++ b/testcases/phpCairo/filter-bilinear-extents.php @@ -3,22 +3,22 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 36, 36); $con = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32, 2, 2); $con2 = new CairoContext($s); -$con2->set_source_rgb(1,0,0); +$con2->setSourceRgb(1,0,0); $con2->paint(); -$con2->set_source_rgb(0,0,1); +$con2->setSourceRgb(0,0,1); $con2->rectangle(0,1,1,1); $con2->rectangle(1,0,1,1); $con2->fill(); -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->paint(); $con->save(); $con->translate(3,3); $con->scale(10,10); $con->translate(0.5,0.5); -$con->set_source_surface($s,0,0); +$con->setSourceSurface($s,0,0); $con->paint(); $con->restore(); -$sur->write_to_png("filter-bilinear-extents-php.png"); +$sur->writeToPng("filter-bilinear-extents-php.png"); ?> diff --git a/testcases/phpCairo/finer-grained-fallbacks-php.png b/testcases/phpCairo/finer-grained-fallbacks-php.png index 6069e33d80842a586be15cd22b8e125337d0d3fe..fa1c259987ec0bdff371b6e6470aeece7f55aafb 100644 GIT binary patch delta 19 acwRfrdYW~D9fu6R8Dmi4`Q01cTA2VqX$GVK delta 19 bcwRfrdYW~D9S1L)nDW<$3p+NtwK4$!MOgtranslate($pad, $pad); -$con->set_source_rgb(0,1,0); -$con->set_operator(OPERATOR_OVER); +$con->setSourceRgb(0,1,0); +$con->setOperator(OPERATOR_OVER); draw_circle($cisize*0.5, $cisize*1.5); -$con->set_source_rgb(1,0,0); -$con->set_operator(OPERATOR_ADD); +$con->setSourceRgb(1,0,0); +$con->setOperator(OPERATOR_ADD); draw_circle($cisize*0.75, $cisize*1.75); -$con->set_source_rgb(0,1,0); -$con->set_operator(OPERATOR_OVER); +$con->setSourceRgb(0,1,0); +$con->setOperator(OPERATOR_OVER); $con->translate($cisize*2.5, $cisize*0.6); draw_circles(); -$con->set_source_rgb(1,0,0); -$con->set_operator(OPERATOR_ADD); +$con->setSourceRgb(1,0,0); +$con->setOperator(OPERATOR_ADD); $con->translate(0, $cisize*2); draw_circles(); -$sur->write_to_png("finer-grained-fallbacks-php.png"); +$sur->writeToPng("finer-grained-fallbacks-php.png"); ?> diff --git a/testcases/phpCairo/font-matrix-translation-php.png b/testcases/phpCairo/font-matrix-translation-php.png index 17712db1905e6513db521cbcb0498ae9496276cb..6faeab252545d678872d9ab02b25190ea00c2b90 100644 GIT binary patch delta 19 bcwXDUwt;Pe9fu6RnXFsEsave(); - $ext = $con->text_extents($str); - $sf = $con->get_scaled_font(); - $sext = $sf->text_extents("text"); - $lw = $con->get_line_width(); + $ext = $con->textExtents($str); + $sf = $con->getScaledFont(); + $sext = $sf->textExtents("text"); + $lw = $con->getLineWidth(); $con->rectangle($x + $ext["x_bearing"]-$lw/2, $y + $ext["y_bearing"] - $lw/2, $ext["width"]+$lw, $ext["height"]+ $lw); $con->stroke(); - $con->move_to($x,$y); - $con->show_text($str); + $con->moveTo($x,$y); + $con->showText($str); $con->restore(); } $sur = new CairoImageSurface(FORMAT_ARGB32, 38, 34); $con = new CairoContext($sur); -$con->set_source_rgb(1,1,1); +$con->setSourceRgb(1,1,1); $con->paint(); -$con->select_font_face("Bitstream Vera Sans"); -$con->set_font_size(12); +$con->selectFontFace("Bitstream Vera Sans"); +$con->setFontSize(12); $con->translate(4,4); -$con->set_line_width(1); -$ext = $con->text_extents("text"); +$con->setLineWidth(1); +$ext = $con->textExtents("text"); -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); box_text("text", 0, -$ext["y_bearing"]); $mat = new CairoMatrix(); $mat->translate(6,16); $mat->scale(12,12); -$con->set_font_matrix($mat); -$con->set_source_rgb(0,0,1); +$con->setFontMatrix($mat); +$con->setSourceRgb(0,0,1); box_text("text", 0, -$ext["y_bearing"]); -$sur->write_to_png("font-matrix-translation-php.png"); +$sur->writeToPng("font-matrix-translation-php.png"); ?> diff --git a/testcases/phpCairo/get-group-target-php.png b/testcases/phpCairo/get-group-target-php.png index 1a1e163d3fa6334e0fe99ddaecbacd16a09ad449..8a4ee1d149757b1be63f5e715a47e2beaf792b25 100644 GIT binary patch delta 18 ZcwTE`Y-5~Y#~~xYrtSFc%H@e}4gfMh1~&iz delta 18 ZcwTE`Y-5~Y$05MSD$~aye0QRo0{|)!1i=6R diff --git a/testcases/phpCairo/get-group-target.php b/testcases/phpCairo/get-group-target.php index eab515a..9aefc5b 100644 --- a/testcases/phpCairo/get-group-target.php +++ b/testcases/phpCairo/get-group-target.php @@ -2,28 +2,28 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 8, 8); $con = new CairoContext($sur); $con->save(); -$con->set_source_rgb(0,0,1); +$con->setSourceRgb(0,0,1); $con->paint(); $con->rectangle(2,2,4,4); $con->clip(); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); $con->paint(); $con->restore(); -$con->push_group(); -$s = $con->get_group_target(); +$con->pushGroup(); +$s = $con->getGroupTarget(); -$con->set_source_rgb(0,1,0); +$con->setSourceRgb(0,1,0); $con->fill(); -$off = $s->get_device_offset(); +$off = $s->getDeviceOffset(); $te = $off["x"]; echo $te; $con->rectangle(2, 2, 4, 4); $con->fill(); -$con->pop_group_to_source(); +$con->popGroupToSource(); $con->paint(); -$sur->write_to_png("get-group-target-php.png"); +$sur->writeToPng("get-group-target-php.png"); ?> diff --git a/testcases/phpCairo/gradient-alpha-php.png b/testcases/phpCairo/gradient-alpha-php.png new file mode 100644 index 0000000000000000000000000000000000000000..759130541c9266a7b48788887a55a1043ae18611 GIT binary patch literal 145 zcwXxa@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDyxmw5WR zvfp5n5nwaj{qyApppdbri(`ny)Z{fO8Fvpmuq6CEbKrNkMr*u8MMvFVdQ&MBb@0O5QvnE(I) literal 0 HcwPel00001 diff --git a/testcases/phpCairo/gradient-alpha.php b/testcases/phpCairo/gradient-alpha.php new file mode 100644 index 0000000..9fd9f93 --- /dev/null +++ b/testcases/phpCairo/gradient-alpha.php @@ -0,0 +1,12 @@ +addColorStopRgba(0,1,0,0,1); +$pat->addColorStopRgba(1,0,0,1,0.5); +$con->setSource($pat); +$con->paint(); + +$sur->writeToPng("gradient-alpha-php.png"); +?> diff --git a/testcases/phpCairo/gradient-zero-stops-php.png b/testcases/phpCairo/gradient-zero-stops-php.png new file mode 100644 index 0000000000000000000000000000000000000000..7f0f6c3747507a2541ece1a5ff6656773747f3dd GIT binary patch literal 105 zcwXxa@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nRwj^(N7l!{JxM1({$v_eI5>H=O x_8V+60_=>#}JO0$q5eZ3=BdHjQPKkw*!S4JYD@<);T3K0RTZC7c&3= literal 0 HcwPel00001 diff --git a/testcases/phpCairo/gradient-zero-stops.php b/testcases/phpCairo/gradient-zero-stops.php new file mode 100644 index 0000000..2466419 --- /dev/null +++ b/testcases/phpCairo/gradient-zero-stops.php @@ -0,0 +1,17 @@ +setSource($pat); +$con->paint(); + +unset($pat); + +$pat = new CairoRadialGradient(0,0,0,1,1,1); +$con->setSource($pat); +$con->paint(); + +$sur->writeToPng("gradient-zero-stops-php.png"); +?> + diff --git a/testcases/phpCairo/group-paint-php.png b/testcases/phpCairo/group-paint-php.png new file mode 100644 index 0000000000000000000000000000000000000000..3598e6200ab03d7d4381e71070647227e8354039 GIT binary patch literal 118 zcwXxa@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDyxmw5WR zvfp5n5n$&|Zax|X6q4|CaSV}|nw*mG2VSRKwuu L>gTe~DWM4ffBGNR literal 0 HcwPel00001 diff --git a/testcases/phpCairo/group-paint.php b/testcases/phpCairo/group-paint.php new file mode 100644 index 0000000..712ccf0 --- /dev/null +++ b/testcases/phpCairo/group-paint.php @@ -0,0 +1,15 @@ +pushGroup(); +$con->setSourceRgb(0,0,1); +$con->paint(); + +$con->popGroupToSource(); +$con->setOperator(OPERATOR_SOURCE); +$con->paint(); + +$sur->writeToPng("group-paint-php.png"); +?> + diff --git a/testcases/phpCairo/image.png b/testcases/phpCairo/image.png index 1e3bd0038d37251c3a2b311684e7d28044e0189d..2b9e61c986cc4800aabdc9066a8d895265a08a9a 100644 GIT binary patch delta 19 acwTF?ZM2 delta 19 acwTF?ZM2@2Y2S5ZZY{YLqS|Wf0AHUUhTKr<=am;zTP=taq|0*lX2#snOh^n5}{+YX_2!%_ai{G9gQLcVDB$d2EG&Bq zoE{N437BssT7%AsJZEstoZddj+3zsN-go=OJ6vJpuTOdML&h59cdqR=-w1^1Mg>hW zJV_P=Yk*w6Yi}onJQET!seKUO-t+D6IBu9p&k3B|t`bGzzXnFx|3D_agwF_aYXC z5BGOLCDerd$A`SMj9}fXyfeIiq=|y_a1(4p!T`}-7Ey^78o22c>_!3RFMr)J2JjYL zY9lY`0sZ2Q7M+mwP(>$CaMnyY0!S;7MpP6`XCc6tD=&z3Z zeVGg=e;MUDYAE)i$Bs1|V`H~xe+V3ag8^pu=741Fue@toVX7Z4d!5u4uQbm0!=vYT+frz~K4n1=?>)Uk%q^~z;eGk3Opko~Y>Fv!~-y`1`&T=n$pETtT z7=QP5xP9OR_mlS-B!Ypn-lf)bX{iK{$}u(uczL@9W3NkoAi0wcxPJ$bqX%o=@%^+v zGxR#NHP@Orl<5G{D^GM?&y)nqMLW%4QC=)HL*khCAKCDJ=+3nUVA3Y(9$^U^=Am;i zJU@Emt)rspaUZ(-h;SFDklTG=R&IL7%bxHh@cCr3kclh&2_N(4gDCH%Ro{%SNckCQ ztJkJGv|DpyPAZC}DM@8?Zg^f+u$_J5!i%f-o*PPNr|iK9Mba;XSk6+-${XDXF;Dz< z<7`oqa1=~|*6$m=+cz^9u)Q61`hv{2_S*vMSfc7kz&N6s7D2_rY&zsLu|I(lkhoao z{U8(3`lD?L&3|RZ<@_OmQRaN@HWw^-c5L~|fZunFcrs1UuleY9FQPJw-Tu7e19D|^ zosyGzsPlw=4}R72RPGQ_Ilvj%Z#x15U?cfbs<6x1>M7Hshp>Po70(bKI3R-aF|IJt zW`?U>oRj*FnMYypTbDJuaGaCJ?s50#G>hJ3r8Lx6(bkf^C3uyOVx?>VD$rfLq!9s0)LF%%%iSFB z`h^#H{!@k$r9UMt8er3WSCAuh?sqG?@$qA6RqxerA!X6(=^1+(t|5eoo5&d=v9#kTyX15&N)rii}Se|9DPt?@;tUYnM5n9Wi&Z;bh z23JHNC4f3O_sXqOsCnN;jyh=Ni`kUP;&kv;>f4sNN}N@XzQxRj5Uqg{x<|B^K$R;7 z>UM$|usHpPFpd*ZhIq)*oC_$?+C0vF+u5zByh$fXwj<(p_yv{plCc)BcmxYO>x_{M zkLuR$x1h;oA|R(l{ner zoU%GHVMn6})pgW#&YR9_;X@6_sb_qyoQQQes0<^po8g$~hxY4s5(VBRFD-w8mF%!YHgrl@UGT-&l za8xtq?<$j6bL(b1D{!)vSf#)GD%|865=k8BGFe+zY;9@wdk}E^RRGm_bnRiBYx@Ys zn-K6NaCCVlYAry4r(zU+x3#JwaZG4`N*6(Ue0px>GJAe*yvE7PV`$HuIBTpil6+eG z1$mnP0n;mB11^~*N~k$qq|>}-u1T#iq=B)(q4colo%2yE0R^$oz;JwubRHoVj5a#A z?d$`GWN;Wiww8aXjQp71{2Gh79zOAq?+h5Gwvo z{hP*60#>PA@)8h3VeK>oc#U^0LyH(Rb^_2UGYwsp5t+H)7yu-gPx@(N(qx~^3 zJi8=Kt*`Ri>UX9l1U2T#)Lb)o$@cwkZz4=WtUy@;)&54BN~DTWaFZ>ntn~-pT|2Tn z+jT>)BO?;ymmGHxQ02r?5?GtJ$SLQs>SoQnsF%sknqoMw%Sc?4YUY3orC4*6ch6^a z$7uSrz)`c_LauC&^Ko2Qau=1YsUzHk2#%Rmd=aC`I_}0TZpz;*?lB9dpjFKBUV9PadH4{IIB0omB%LC*X z)nC$vtz&*QV(N8@9d{PNJ0l^{>-jp0QQ;JFKf~w#^uE7Y{XphHXRF`}9h?p!{*3Y5 zizxju(A=R=c%vou z@DR(aTfjDuvz*8~mFIau;&ai(rg;s*fL1OKp0?jk4(q*F_)yeit z@m9VD8NM~F;7MT6qSr%k*KJ8JRt7s-;9t}uz=DSv_4x#6v|sutef-+;TGRBzeiNcK z&j?DVHZ{`%sDyUspuq;dva@sG{KRC^=~7S`Yd0+j&-p6i;Mis_H~xc0oh7D+74y6u zobFW}N%quMN*|Qb+}pz#=M|p9%N&NdJ;-*V)pd_0$iUZ7y50F=nsfV;h^(~LoV^^F z>FzDApv1UZ^o~!hCdmhL4A7{0gm8%x5=`8^hHQ#-WMAvXxbJA|TA3Bo%` wpS>EkX`6C>-6Y-Rdime}Km5P_Z#9`r4JjwZUC^R!#%ab*M_e2$50iiXCxwS$8~^|S literal 0 HcwPel00001 diff --git a/testcases/phpCairo/image_text_extents.png b/testcases/phpCairo/image_text_extents.png index 94d1deb84b38e4d254d2246ad81c97d7751726a9..db977e0ab6058b744343f7a3f34117f5d8f23bb8 100644 GIT binary patch delta 19 bcwU=oHq~r`9fyn%pM+`k>%|-0&PxFRKJ5nI delta 19 bcwU=oHq~r`9S5h7nB|;vM>sdSotFXtK@$e< diff --git a/testcases/phpCairo/infinite-join-php.png b/testcases/phpCairo/infinite-join-php.png new file mode 100644 index 0000000000000000000000000000000000000000..3645c05b302f0e00f3ae5edae59a3d64747cffcf GIT binary patch literal 194 zcwXxa@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqY)RhkE)4%caKYZ?lYt`aC7!;n z>^InC1lR>$KI7R26iV@QaSV}|+S|8~_kesetSourceRgb(1,1,1); +$con->paint(); + +$con->setSourceRgb(0,0,0); +$con->setLineJoin(LINE_JOIN_ROUND); +$con->scale(20.0/100.0, 20/100.); +$con->scale(1./20, 1./20); +$con->setLineWidth(20); +$con->translate ( -18300, -13200); + +$con->newPath (); +$con->moveTo ( 18928, 13843); +$con->lineTo ( 18500, 13843); +$con->lineTo ( 18500, 13400); +$con->lineTo ( 18928, 13400); +$con->lineTo ( 18928, 13843); +$con->stroke (); +$sur->writeToPng("infinite-join-php.png"); +?> + diff --git a/testcases/phpCairo/large-font-php.png b/testcases/phpCairo/large-font-php.png new file mode 100644 index 0000000000000000000000000000000000000000..3b86e19056a2b7698065bfe5ea00d6927f48c561 GIT binary patch literal 6938 zcwX&S`B&3d7Jq@T6%aKliVHX{(Xj{?5!q8w(Nc(lN^3Qg*yTKg#Bo%URz!Q~#{q}oQ-Yc(KsIm-P zNI4IHPQm`&-yaI$47B!Lb5mMf)-FzXSQ~yn`;Qt&?=4Gszhvk|sa`s=Ws}~nk_~&K z_ePg`8tQyprm^_?!iacfCD*37(#Kwxl%1C>^=^)9E>;yUk8n(S+cK0l(b6-eSTR*3 zZyCGuBRAE3bBH>DKnNWEP})=!9$M=Jz;fz3do8M=#mw-_kBWfpB--pj3Q^B(4LWK$ z{pqQFB>+iEcvZT0?IU|*BO|A`xAbWY7_R;Ye3Z#{D=YUKH*O$3({-c}8!f9zs#{Rw zFPPRI4%P2RLC`>|qRN8pmQdu@BE5nN*|;RFc|i2n%`JBl6#(h&&eD&ptI^T*ot+OR zp%M|VI@d8Ro@2V5>$-`VdB~xTq~7t(PhrkYi=DZ(UfAs$NRLxfb7&2s>if15X)T$K zop$4+bXKfL37`IaSqlJ$1N*>)n8hmWu^jSZz=YV8sEJ|)gZYwvGE3$Zebw_I6e6=V zvg*^EopYP{(B2M9CBRUh2ZMs4B8GUntwE{*K;%^dZ>@AN zxLDvG(tbf_y%OS*1*q+h;#`4JZY(qXk&k?WHa`&XO# zKX`V!u|~QCfDkBoOV(J)+-LcqCko^kX$>n%GRWfRazJKtpH#+l0(gT)fy~z3;p~F!@6KI zu129JG1PapRoL@o2JS7`EB?AHo1IT!2otZqpz>;(J25*{0MrA82QZ2kJ{bd>VuG8Wdfx<+X~JZ8yjzcaV+1da01ACZLL%7 z3<|T6LuX!asG5J?p%>*br<=t)ApL;D6|h2Y<&M*jeRGd)Il}WqhB!;0p`TBm=4~Vr zU#q~vwP$Nw(w+IB68L(l^L9+@GJ%I1o}DNzW=;sihyTMr&SG3mPld(UJ2QsVlkb|7 zigI-3FAjA)tGc?nDVKg1k=Yo(PggKEJ1uFVWngJ~w}MCs?=Kt*r^`pKv3S=PMXLf* zsA{ZLHeSfglO*X@xg(Rtni_Rn-^JpTbRCjBF)>KE;W) zPiyU~Lb>BT~=xa4)CfP?RrZK3VOD~x8*%b;3arz5-~Ak z7fRkC{63o^=|h8hTWeW0$`$Dk0#Er^K=q#S8aspfSFd)X{-XB-`!{`;Cl5}ZJn22w zU5-V!lSui=dTy!`L2hHm#)p4?dY5lLRPYp~u4*}vvbOn|Puh7EEm4G$dOYkCAbOD= zE^3*6s?Eg(^&I|hZ=Kf>77 zH?QlKtenoQ#VpYjPAuSre{Muf{z^cpF_FUc{F{KQRB--R)`WccmC+z*!zyyQszatj zX+?s$B(Eni&4F8s@~~W0p>sX|Xl{CbtM6C(85(k^3BUbKKQ>`K$>BwC(O5!$cRUS? zPO(f)q?SJ`lSs5!lQyscngFo#ph72}=koMX%o+cTMm5%CBqt-BA2is4f$XUXC8%XFtH(b^8Hgq)Lokqy@xpC9O4hxT zr%p*eJ+1Ubwz97fc*iGS8!*>GLrE%l;oQ{d?c!s(E&g`3M)2e&hg$gNwYJAGgF>le z`5luCtSWv`=q$eVt&5|Pkx|aMv2Lt6(o9Qb8LfigD9E1PZ8*oncc)u=`eV!oJyAtu zw^iMx`ZPb|&&r2b4X|TjjN_Zs;huO_-!luFJcGD}kvZA0j!3y?J^LKtl$5L)OJO2(i7-u}`-=&w`-RrbfF^1R(V_kphPgr2J-t>b2}0 zBt*fctmC$rN`q&Yn&^KR_`%p!TMven1``eQjWwEKmTO>yv6-3c^u&-hY&2C|*QI)5 z`Czc5KP|%-!8)w$dNv~PrKU+8oE#qO*73dn3A2Cm2wu426z5>8Z?1^v^2NNp#!OGd ze-RL8IE)+R)5Fu!i)UpB5K#705;-$HuRC7$)??Q3{{8z{EHN)jl!d8>(^BD*ksm0* zU|Plf)uOaNz-$~Y3Mk#n4HZ}DdCbWgB#OF|BrHV2_A^9^^D)0Ya+vRotgI}=5kT}z zQaJJY%2L=(X)hx+u?rktkP@hJNV+93LcwN!0`%Tsh+7O(TA+=En>RbA{a`Bf1vXO0O_wz$P#5 z26u?0G+C%7>h1L$5EpyEq9}=t!V4#gCJN!GOk11*1D8=M$(gbqqkxx~!(qZGxV{S*3=(Zp^Sj(lzr|!5@63BgEBuaD7LE ztSQ^8b`=?7(bWHdoEbFKrjJ4-_&ef8FBpU+`xeVT=e5C~vs=_)8x$86x-+M`;;mWC zYuNpPyKqlJMn0PPckU~MkPNl2hi!xJ(2JLFt>r1mD~BdO6(RhmFMoPa5Sj-kgJ)ic zS*h9F%$TGq*(T>q`->7xsclqU2pLIZFkE4>0QZx=VrR9jE?<4?bG*(}BT?E03%-Q$Cy@dlHpZ5gSR|%_@4&gq_KT7i>IOg3p_1!h zAd&L*QKMOonPDk(a?VzyG&VN6K0EDl9zM+2&lux)T3A@YqeqWkAzm0|C=1VPSy67g z1-ab7pp_h|-}3cQQ;7M8o-`hPL4q9ruD>4T!Wi^Tp0MVas1kPvxWj}VpCtxB)x4m0 ztlg^6sJa4V?xjWWok+S0pw!QJc)D;M3Cb+T!C+pgE`(LJmkmvAn-`rIofn-Kofn-K qofn-Kofn-Kofn-K{XY_Y#{$`}$mEiT-9q>S*uTeNcls`B#J>T;ZV5R6 literal 0 HcwPel00001 diff --git a/testcases/phpCairo/large-font.php b/testcases/phpCairo/large-font.php new file mode 100644 index 0000000..0de831e --- /dev/null +++ b/testcases/phpCairo/large-font.php @@ -0,0 +1,15 @@ +setSourceRgb(1,1,1); +$con->paint(); +$con->selectFontFace("Bitstream Vera Sans"); +$con->setFontSize(10000); +$con->setSourceRgb(0,0,0); +$con->moveTo(-5000, 5000); +$con->showText("xW"); + +$sur->writeToPng("large-font-php.png"); +?> diff --git a/testcases/phpCairo/large-source-php.png b/testcases/phpCairo/large-source-php.png index a91416a65969f7a46fe9ce009b93cfeb4ef805e4..2cd0c84fb85f0f211749d84f549969fd43a009ea 100644 GIT binary patch delta 18 ZcwXyd>|~r^#~~xYF7qJ3VeUjXX8|~r^$HB|Pr7Xu-$vn}`82}~*1Lgn# diff --git a/testcases/phpCairo/large-source.php b/testcases/phpCairo/large-source.php index 5064bf6..e57002c 100644 --- a/testcases/phpCairo/large-source.php +++ b/testcases/phpCairo/large-source.php @@ -3,33 +3,33 @@ $sur = new CairoImageSurface(FORMAT_ARGB32,20,20); $redmask = 0x5; $greenmask = 0x50; $con = new CairoContext($sur); -$con->set_source_rgb(0,0,1); +$con->setSourceRgb(0,0,1); $con->paint(); $s = new CairoImageSurface(FORMAT_A1, 6400,20); -$stride = $s->get_stride(); -$height = $s->get_height(); -$width = $s->get_width(); +$stride = $s->getStride(); +$height = $s->getHeight(); +$width = $s->getWidth(); $data = ""; for($y = 0; $y<$height; $y++) { for($x=0; $x<($width+7)/8; $x++) $data = $data . chr(5); } -$s->create_from_data($data,FORMAT_A1,$width, $height, $stride); -$con->set_source_rgb(1,0,0); -$con->mask_surface($s); +$s->createFromData($data,FORMAT_A1,$width, $height, $stride); +$con->setSourceRgb(1,0,0); +$con->maskSurface($s); $con->fill(); $s = new CairoImageSurface(FORMAT_A1,20, 6400); -$stride = $s->get_stride(); -$height = $s->get_height(); -$width = $s->get_width(); +$stride = $s->getStride(); +$height = $s->getHeight(); +$width = $s->getWidth(); $data = ""; for($y = 0; $y<$height; $y++) { for($x=0; $x<($width+7)/8; $x++) $data = $data . chr(80); } -$s->create_from_data($data,FORMAT_A1,$width, $height, $stride); -$con->set_source_rgb(0,1,0); -$con->mask_surface($s,0,0); +$s->createFromData($data,FORMAT_A1,$width, $height, $stride); +$con->setSourceRgb(0,1,0); +$con->maskSurface($s,0,0); -$sur->write_to_png("large-source-php.png"); +$sur->writeToPng("large-source-php.png"); ?> diff --git a/testcases/phpCairo/leaky-dash-php.png b/testcases/phpCairo/leaky-dash-php.png new file mode 100644 index 0000000000000000000000000000000000000000..f83a9dd89a0203456fecbb07464134bec2d14f06 GIT binary patch literal 243 zcwXxa@N?(olHy`uVBq!ia0vp^?m#TV!3HFae=gDnQfx`y?k)`fL2$v|<&%LT>?NMQ zuIxA1WCYkX4nEnU0Ti0*>Eaj?(fao0L9SK>0k?;eFaO3@Ms+MztItz9`1!4#M+{#u z&kI4pwuOuTJ$(16;N_0PJ3CGk-jmy={d{ZIRL7la?AxotCPl70y87#sfB%?QuVinv zU@ByJ#BoHhLs`Jx;>@k1?B-@q_@qCn?6Z_Ld*TTZSLkz)Y2=MeaDI2C*{IZX^QXU; kra%AjjAu&4ooG(=tIQsrSq8kiKnF5-y85}Sb4q9e0O+hsetSourceRgb ( 1, 1, 1); + $con->paint (); + + $con->setSourceRgb ( 0., 0., 0); + + //$con->translate ( 0.5, .5); + $con->setLineWidth ( 2); /* This is vital to reproduce the bug. */ + + /* First check simple rectangles */ + $con->rectangle (2,2,67,24); + + $con->setDash ( $dash, 2, 9.0); + + $con->stroke (); + $sur->writeToPng("leaky-dash-php.png"); +?> diff --git a/testcases/phpCairo/leaky-dashed-rectangle-php.png b/testcases/phpCairo/leaky-dashed-rectangle-php.png index 3a4149db42dde5164db772f88d91e7e22ba245ed..b2feef6e3d15acf950723170e13c56f6bbc100f8 100644 GIT binary patch delta 19 acwU>&JfC@j9fynnyUwxB0>h1Nk&FO1um!sS delta 19 acwU>&JfC@j9S1Lu5RdukJIov1A{hZT76pU= diff --git a/testcases/phpCairo/leaky-dashed-rectangle.php b/testcases/phpCairo/leaky-dashed-rectangle.php index 9436ae9..80f4b85 100644 --- a/testcases/phpCairo/leaky-dashed-rectangle.php +++ b/testcases/phpCairo/leaky-dashed-rectangle.php @@ -6,16 +6,16 @@ $dash = array(4.0, 2.0); - $con->set_source_rgb ( 1, 1, 1); + $con->setSourceRgb ( 1, 1, 1); $con->paint (); - $con->set_source_rgb ( 0., 0., 0); + $con->setSourceRgb ( 0., 0., 0); $con->translate ( 0.5, .5); - $con->set_line_width ( 1); /* This is vital to reproduce the bug. */ + $con->setLineWidth ( 1); /* This is vital to reproduce the bug. */ /* First check simple rectangles */ - $con->set_source_rgb ( 0., 0., 0); + $con->setSourceRgb ( 0., 0., 0); $con->rectangle ( -$width/4, -$height/4, $width, $height); $con->stroke (); $con->rectangle ( $width+$width/4, -$height/4, -$width, $height); @@ -25,20 +25,20 @@ $con->rectangle ( $width+$width/4, $height+$height/4, -$width, -$height); $con->stroke (); - $con->set_dash ( $dash, 2, 0); + $con->setDash ( $dash, 2, 0); /* And now dashed. */ - $con->set_source_rgb ( 1., 0., 0); + $con->setSourceRgb ( 1., 0., 0); $con->rectangle ( -$width/4, -$height/4, $width, $height); $con->stroke (); - $con->set_source_rgb ( 0., 1., 0); + $con->setSourceRgb ( 0., 1., 0); $con->rectangle ( $width+$width/4, -$height/4, -$width, $height); $con->stroke (); - $con->set_source_rgb ( 0., 0., 1); + $con->setSourceRgb ( 0., 0., 1); $con->rectangle ( -$width/4, $height+$height/4, $width, -$height); $con->stroke (); - $con->set_source_rgb ( 1., 1., 0); + $con->setSourceRgb ( 1., 1., 0); $con->rectangle ( $width+$width/4, $height+$height/4, -$width, -$height); $con->stroke (); - $sur->write_to_png("leaky-dashed-rectangle-php.png"); + $sur->writeToPng("leaky-dashed-rectangle-php.png"); ?> diff --git a/testcases/phpCairo/line-width-scale-php.png b/testcases/phpCairo/line-width-scale-php.png index 17b9e79e48327874d620cd8243759450c45de717..51fe86af147be9a887825e634de7043aab88f0c6 100644 GIT binary patch delta 19 acwSp;wAN^X9fynnyOB+sZ_q}!=Mn%ty#`SL delta 19 bcwSp;wAN^X9S5(VuJjKJ=i3|Io=X4#L+}Sb diff --git a/testcases/phpCairo/line-width-scale.php b/testcases/phpCairo/line-width-scale.php index f34df0d..3589bfc 100644 --- a/testcases/phpCairo/line-width-scale.php +++ b/testcases/phpCairo/line-width-scale.php @@ -4,9 +4,9 @@ function spline_path () global $spline,$con; $con->save (); { - $con->move_to ( + $con->moveTo ( - $spline, 0); - $con->curve_to ( + $con->curveTo ( - $spline / 4, - $spline, $spline / 4, $spline, $spline, 0); @@ -18,7 +18,7 @@ function scale_then_set_line_width_and_stroke () { global $con,$xscale,$yscale,$linewidth; $con->scale ( $xscale, $yscale); - $con->set_line_width ( $linewidth); + $con->setLineWidth ( $linewidth); spline_path (); $con->stroke (); } @@ -36,7 +36,7 @@ function scale_path_and_line_width () $con->save (); { $con->scale ( $xscale, $yscale); - $con->set_line_width ( $linewidth); + $con->setLineWidth ( $linewidth); $con->stroke (); } $con->restore (); @@ -45,7 +45,7 @@ function scale_path_and_line_width () function set_line_width_then_scale_and_stroke() { global $con, $xscale, $yscale,$linewidth; - $con->set_line_width ( $linewidth); + $con->setLineWidth ( $linewidth); $con->scale ( $xscale, $yscale); spline_path (); $con->stroke (); @@ -64,7 +64,7 @@ function scale_path_not_line_width () $con->save (); { - $con->set_line_width ( $linewidth); + $con->setLineWidth ( $linewidth); $con->stroke (); } $con->restore (); @@ -78,9 +78,9 @@ function scale_path_not_line_width () $height = ($yscale * $spline * 2.0); $sur = new CairoImageSurface(FORMAT_ARGB32, $width, $height); $con = new CairoContext($sur); - $con->set_source_rgb ( 1.0, 1.0, 1.0); /* white */ + $con->setSourceRgb ( 1.0, 1.0, 1.0); /* white */ $con->paint (); - $con->set_source_rgb ( 0.0, 0.0, 0.0); /* black */ + $con->setSourceRgb ( 0.0, 0.0, 0.0); /* black */ for($i =0 ; $i<4;$i++) { $con->save(); // $con->translate($width/4 + ($i % 2)*$width/2, $height/4 + ($i/2)*$height/2); @@ -104,7 +104,7 @@ function scale_path_not_line_width () } $con->restore(); } -$sur->write_to_png("line-width-scale-php.png"); +$sur->writeToPng("line-width-scale-php.png"); ?> diff --git a/testcases/phpCairo/linear-gradient-reflect-php.png b/testcases/phpCairo/linear-gradient-reflect-php.png index 07ab8d92443954852c373f3360272972aa7981f8..c37b5d848e21b7d55e2c94c4f3530a46b59c53a1 100644 GIT binary patch delta 18 acwW27c$0C09fynn2h-f+iG~y1CIbLD1_mJj delta 18 acwW27c$0C09S5(Fu~set_source_rgb ( 0.5, 0.5, 0.5); +$con->setSourceRgb ( 0.5, 0.5, 0.5); $con->paint (); $con->save (); $pattern = new CairoLinearGradient(0, 0, 10.0, 0); -$pattern->add_color_stop_rgb ( 0.0, 0.0, 0.0, 1.0); -$pattern->add_color_stop_rgb ( 1.0,1.0, 0.0, 0.0); -$pattern->set_extend (EXTEND_REFLECT); -$con->set_source ($pattern); +$pattern->addColorStopRgb ( 0.0, 0.0, 0.0, 1.0); +$pattern->addColorStopRgb ( 1.0,1.0, 0.0, 0.0); +$pattern->setExtend (EXTEND_REFLECT); +$con->setSource ($pattern); $con->rectangle ( 0.0, 0.0, $width, $height); $con->fill (); $con->restore (); -$sur->write_to_png("linear-gradient-reflect-php.png"); +$sur->writeToPng("linear-gradient-reflect-php.png"); ?> diff --git a/testcases/phpCairo/long-lines-php.png b/testcases/phpCairo/long-lines-php.png new file mode 100644 index 0000000000000000000000000000000000000000..f6f0078c5c92cf1831a0e61b57fa8b5f77250a60 GIT binary patch literal 290 zcwXxa@N?(olHy`uVBq!ia0vp^ZXnFT1|$ph9<=}|wj^(N7l!{JxM1({$v_eI5>H=O z_8V+60vsH*LLK@*p(CCyjv*Cu-d@2z!({F{chU6tPKAYFcFaG9M^?S>W z*UlU)IXlaiefRp^zxO?_oVRn`>*s}j|N6q7A3lHby1kGZhj0t$A(q4@1IHN(J_2;+ awupDs2zNX#GkgQ|4}+(xpUXO@geCw$xnF$% literal 0 HcwPel00001 diff --git a/testcases/phpCairo/long-lines.php b/testcases/phpCairo/long-lines.php new file mode 100644 index 0000000..1954af6 --- /dev/null +++ b/testcases/phpCairo/long-lines.php @@ -0,0 +1,41 @@ +100.0, "r"=>1, "g"=>0, "b"=>0); +$line[1] = array("len"=>10000.0, "r"=>0, "g"=>1, "b"=>0); +$line[2] = array("len"=>10000.0, "r"=>0, "g"=>0, "b"=>1); +$line[3] = array("len"=>10000.0, "r"=>1, "g"=>1, "b"=>0); +$line[4] = array("len"=>10000.0, "r"=>0, "g"=>1, "b"=>1); +$line[5] = array("len"=>10000.0, "r"=>1, "g"=>0, "b"=>1); + +$con->save(); +$con->setSourceRgb(1,1,1); +$con->paint(); +$con->restore(); +$con->save(); +$con->setLineWidth(1); + +$pos = 10.5; + +for($i =0; $i < 6; $i++) { + $con->moveTo($pos, -$line[$i]["len"]); + $con->lineTo($pos, $line[$i]["len"]); + $con->setSourceRgb($line[$i]["r"], $line[$i]["g"], $line[$i]["b"]); + $con->stroke(); + $pos+=10; +} +$con->restore(); +$con->moveTo(35, -10000); +$con->lineTo(35, 10000); +$con->setLineWidth(1); +//$con->set_source_rgb(0,0,0,); +$con->stroke(); + +$sur->writeToPng("long-lines-php.png"); +?> + + + diff --git a/testcases/phpCairo/mask-ctm-php.png b/testcases/phpCairo/mask-ctm-php.png index a06d9cde4cd58abaecfac90095d958ce3983d96c..72316bd4f926fa65bee4fcace66f208ef4a44107 100644 GIT binary patch delta 84 zcwXyf>}H%`=PM(?!OL4wvw(qtLD$p8F+^f&a>4@1ALkDUe4XETkbSz1u+Z*?#>R)% oN7alI1HEUSyy2sAK4lUk16w7J#veHwcA!QEPgg&ebxsLQ0K&!`-~a#s delta 84 zcwXyf>}H%`=gTY1VXdK4@1ALkDUe4XEzD5Y1arcx%!%*?ER oRLwXs(0k^|8$K%MQzkJoJnrU-x~}vl6R45F)78&qol`;+0AR!$)c^nh diff --git a/testcases/phpCairo/mask-ctm.php b/testcases/phpCairo/mask-ctm.php index 8e54222..b521224 100644 --- a/testcases/phpCairo/mask-ctm.php +++ b/testcases/phpCairo/mask-ctm.php @@ -11,9 +11,9 @@ for($i = 0; $i<4; $i++) { } $s = new CairoImageSurface(FORMAT_ARGB32,1,1); -$s->create_from_data(data,FORMAT_ARGB32, 2, 2, 8); +$s->createFromData(data,FORMAT_ARGB32, 2, 2, 8); $pat = new CairoSurfacePattern($s); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); $con->save(); $con->translate(2,2); @@ -22,14 +22,14 @@ $con->restore(); $mat = new CairoMatrix(); $mat->translate(-4,-4); -$pat->set_matrix($mat); +$pat->setMatrix($mat); $con->mask($pat); $con->translate(2,2); $con->mask($pat); -$sur->write_to_png("mask-ctm-php.png"); +$sur->writeToPng("mask-ctm-php.png"); ?> diff --git a/testcases/phpCairo/mask-surface-ctm-php.png b/testcases/phpCairo/mask-surface-ctm-php.png index f8c5ba2bcc84b24bd6095106c3888d6a75b668d4..5f7164c955a98d993813fb0cdff4baff616dcf0f 100644 GIT binary patch delta 84 zcwPZi0IUCo0gC~UK201D6CYRi#&Q4v04+&GK~xx(V_={e_|L!)^`C*^H7Ibnh1kMjovzRquScreate_from_data(data,FORMAT_ARGB32, 2, 2, 8); +$s->createFromData(data,FORMAT_ARGB32, 2, 2, 8); //$pat = new CairoSurfacePattern($s); -$con->set_source_rgb(1,0,0); +$con->setSourceRgb(1,0,0); $con->save(); $con->translate(2,2); -$con->mask_surface($s,0,0); +$con->maskSurface($s,0,0); $con->restore(); -$con->mask_surface($s,4,4); +$con->maskSurface($s,4,4); //$mat = new CairoMatrix(); $con->translate(2,2); -//$pat->set_matrix($mat); +//$pat->setMatrix($mat); -$con->mask_surface($s,4,4); +$con->maskSurface($s,4,4); -$sur->write_to_png("mask-surface-ctm-php.png"); +$sur->writeToPng("mask-surface-ctm-php.png"); ?> diff --git a/testcases/phpCairo/meta-surface-pattern-php.png b/testcases/phpCairo/meta-surface-pattern-php.png index 16bdbc59362fb327d6f180623d90e21881b9ef26..743404fe4e8a33c2c70c27d05de17a53c28eac40 100644 GIT binary patch delta 19 acwTFeXpop-#~~vitXwf;*Vm11ySM>6ng-+m delta 19 acwTFeXpop-$H6PCBweG@UA56|7dHSj$OXj! diff --git a/testcases/phpCairo/meta-surface-pattern.php b/testcases/phpCairo/meta-surface-pattern.php index 6dd5a06..06cf8bb 100644 --- a/testcases/phpCairo/meta-surface-pattern.php +++ b/testcases/phpCairo/meta-surface-pattern.php @@ -14,51 +14,51 @@ $con = new CairoContext($sur); $con->translate ( $pad, $pad); - $pat_surface = $sur->create_similar ( + $pat_surface = $sur->createSimilar ( CONTENT_COLOR_ALPHA, $patwidth, $patheight); $cr2 = new CairoContext($pat_surface); - $cr2->set_source_rgba (1, 0, 1, 0.5); + $cr2->setSourceRgba (1, 0, 1, 0.5); $cr2->rectangle ($patwidth/6.0, $patheight/6.0, $patwidth/4.0, $patheight/4.0); $cr2->fill (); - $cr2->set_source_rgba (0, 1, 1, 0.5); + $cr2->setSourceRgba (0, 1, 1, 0.5); $cr2->rectangle ($patwidth/2.0, $patheight/2.0, $patwidth/4.0, $patheight/4.0); $cr2->fill (); - $cr2->set_line_width (1); - $cr2->move_to ($patwidth/6.0, 0); - $cr2->line_to (0, 0); - $cr2->line_to (0, $patheight/6.0); - $cr2->set_source_rgb (1, 0, 0); + $cr2->setLineWidth (1); + $cr2->moveTo ($patwidth/6.0, 0); + $cr2->lineTo (0, 0); + $cr2->lineTo (0, $patheight/6.0); + $cr2->setSourceRgb (1, 0, 0); $cr2->stroke (); - $cr2->move_to ($patwidth/6.0, $patheight); - $cr2->line_to (0, $patheight); - $cr2->line_to (0, 5*$patheight/6.0); - $cr2->set_source_rgb (0, 1, 0); + $cr2->moveTo ($patwidth/6.0, $patheight); + $cr2->lineTo (0, $patheight); + $cr2->lineTo (0, 5*$patheight/6.0); + $cr2->setSourceRgb (0, 1, 0); $cr2->stroke (); - $cr2->move_to (5*$patwidth/6.0, 0); - $cr2->line_to ($patwidth, 0); - $cr2->line_to ($patwidth, $patheight/6.0); - $cr2->set_source_rgb (0, 0, 1); + $cr2->moveTo (5*$patwidth/6.0, 0); + $cr2->lineTo ($patwidth, 0); + $cr2->lineTo ($patwidth, $patheight/6.0); + $cr2->setSourceRgb (0, 0, 1); $cr2->stroke (); - $cr2->move_to (5*$patwidth/6.0, $patheight); - $cr2->line_to ($patwidth, $patheight); - $cr2->line_to ($patwidth, 5*$patheight/6.0); - $cr2->set_source_rgb (1, 1, 0); + $cr2->moveTo (5*$patwidth/6.0, $patheight); + $cr2->lineTo ($patwidth, $patheight); + $cr2->lineTo ($patwidth, 5*$patheight/6.0); + $cr2->setSourceRgb (1, 1, 0); $cr2->stroke (); - $cr2->set_source_rgb (0.5, 0.5, 0.5); - $cr2->set_line_width ($patwidth/10.0); + $cr2->setSourceRgb (0.5, 0.5, 0.5); + $cr2->setLineWidth ($patwidth/10.0); - $cr2->move_to (0, $patheight/4.0); - $cr2->line_to ($patwidth, $patheight/4.0); + $cr2->moveTo (0, $patheight/4.0); + $cr2->lineTo ($patwidth, $patheight/4.0); $cr2->stroke (); - $cr2->move_to ($patwidth/4.0, 0); - $cr2->line_to ($patwidth/4.0, $patwidth); + $cr2->moveTo ($patwidth/4.0, 0); + $cr2->lineTo ($patwidth/4.0, $patwidth); $cr2->stroke (); $pattern = new CairoSurfacePattern ($pat_surface); @@ -67,10 +67,10 @@ $con = new CairoContext($sur); $mat->scale ( 2, 1.5); $mat->rotate ( 1); $mat->translate ( -$patwidth/4.0, -$patwidth/2.0); - $pattern->set_matrix ( $mat); - $pattern->set_extend ( EXTEND_NONE); + $pattern->setMatrix ( $mat); + $pattern->setExtend ( EXTEND_NONE); - $con->set_source ( $pattern); + $con->setSource ( $pattern); $con->paint (); - $sur->write_to_png("meta-surface-pattern-php.png"); + $sur->writeToPng("meta-surface-pattern-php.png"); ?> diff --git a/testcases/phpCairo/miter-precision-php.png b/testcases/phpCairo/miter-precision-php.png index 9780871911c505244b545a8b98c4ec81eefeea98..a714294a5db7dacb5012ef1c959df536d580feda 100644 GIT binary patch delta 19 bcwW27ev^HI9fyp7sKoq}U&1%KO=boFMhpiq delta 19 bcwW27ev^HI9S5(lK7;dno7)@RCNl#7LK6nO diff --git a/testcases/phpCairo/miter-precision.php b/testcases/phpCairo/miter-precision.php index b0fdce5..2131a8f 100644 --- a/testcases/phpCairo/miter-precision.php +++ b/testcases/phpCairo/miter-precision.php @@ -2,11 +2,11 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 120, 100); $con = new CairoContext($sur); -$con->set_source_rgb ( 1, 1, 1); +$con->setSourceRgb ( 1, 1, 1); $con->paint (); -$con->set_source_rgb ( 0, 0, 0); -$con->set_miter_limit (100000); +$con->setSourceRgb ( 0, 0, 0); +$con->setMiterLimit (100000); for ($xscale = 1; $xscale <= 1000; $xscale += 999) for ($yscale = 1; $yscale <= 1000; $yscale += 999) { @@ -18,12 +18,12 @@ for ($xscale = 1; $xscale <= 1000; $xscale += 999) if ($yscale > 1) $con->translate ( 0, 50); $con->scale ( $xscale,$yscale); - $con->set_line_width ( 10.0 / $max_scale); - $con->move_to ( 10.0 / $xscale, 10.0 / $yscale); - $con->line_to ( 40.0 / $xscale, 10.0 / $yscale); - $con->line_to ( 10.0 / $xscale, 30.0 / $yscale); + $con->setLineWidth ( 10.0 / $max_scale); + $con->moveTo ( 10.0 / $xscale, 10.0 / $yscale); + $con->lineTo ( 40.0 / $xscale, 10.0 / $yscale); + $con->lineTo ( 10.0 / $xscale, 30.0 / $yscale); $con->stroke (); $con->restore (); } -$sur->write_to_png("miter-precision-php.png"); +$sur->writeToPng("miter-precision-php.png"); ?> diff --git a/testcases/phpCairo/move-to-show-surface-php.png b/testcases/phpCairo/move-to-show-surface-php.png index 0ede4eaa94dee35d9e260a5a67c62e6e388c4756..8ca212acbf085bb94c9927f82794c862517c4ff4 100644 GIT binary patch delta 16 XcwQ?hnPA5uBOuPOZ!%x=L^nMEDToB= delta 16 XcwQ?hnPA7kE5anmV-?^$(M=BkA}j;Z diff --git a/testcases/phpCairo/move-to-show.php b/testcases/phpCairo/move-to-show.php index fbf0f2c..772062f 100644 --- a/testcases/phpCairo/move-to-show.php +++ b/testcases/phpCairo/move-to-show.php @@ -39,11 +39,11 @@ $c[3] = $color; for($i =0 ; $i<4;$i++) { - $s ->create_from_data($c[$i], FORMAT_RGB24, 1 , 1, 4); - $con->set_source_surface($s, $i%2, $i/2); + $s ->createFromData($c[$i], FORMAT_RGB24, 1 , 1, 4); + $con->setSourceSurface($s, $i%2, $i/2); $con->paint(); } -$sur->write_to_png("move-to-show-surface-php.png"); +$sur->writeToPng("move-to-show-surface-php.png"); ?> diff --git a/testcases/phpCairo/nil-surface.php b/testcases/phpCairo/nil-surface.php index 3ab4949..e109653 100644 --- a/testcases/phpCairo/nil-surface.php +++ b/testcases/phpCairo/nil-surface.php @@ -2,19 +2,19 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 1, 1); $con = new CairoContext($sur); -$con2 = new CairoContext($con->get_target()); +$con2 = new CairoContext($sur); $s = new CairoImageSurface(FORMAT_ARGB32, 0, 0); -$s->create_from_png("__THIS_FILE_DOES_NOT_EXIST"); +$s->createFromPng("__THIS_FILE_DOES_NOT_EXIST"); $pat = new CairoSurfacePattern($s); -$con2->set_source($pat); +$con2->setSource($pat); $con2->paint(); -$con2=$con->get_target(); +$con2=$con->getTarget(); $pat = new CairoSurfacePattern(NULL); -$con2->set_source($pat); +$con2->setSource($pat); $con2->paint(); -$sur->write_to_png("nil-surface-php.png"); +$sur->writeToPng("nil-surface-php.png"); ?> diff --git a/testcases/phpCairo/operator-clear-php.png b/testcases/phpCairo/operator-clear-php.png index e599aa349dec1043f62df4b7561f9b3d4250f565..dbc8968e60380fe31a95f5a0d0e3e2d9857c5f56 100644 GIT binary patch delta 19 bcwU>sIfrwC9fypdhT`gHao0Awg|PqtK7R(S delta 19 acwU>sIfrwC9S0v53#0R`W2PJ3!dL({xdo>H diff --git a/testcases/phpCairo/operator-clear.php b/testcases/phpCairo/operator-clear.php index 4f44989..32b65ef 100644 --- a/testcases/phpCairo/operator-clear.php +++ b/testcases/phpCairo/operator-clear.php @@ -7,7 +7,7 @@ $pad = 2; function set_solid_pattern ($x, $y) { global $con; - $con->set_source_rgb (1.0, 0, 0.0); + $con->setSourceRgb (1.0, 0, 0.0); } function set_gradient_pattern ($x, $y) @@ -15,9 +15,9 @@ function set_gradient_pattern ($x, $y) global $con,$width,$height; $pat = new CairoLinearGradient ($x, $y, $x + $width, $y + $height); - $pat->add_color_stop_rgba (0.2, 1, 0, 0, 1); - $pat->add_color_stop_rgba ( 0.8, 1, 0, 0, 0.0); - $con->set_source ($pat); + $pat->addColorStopRgba (0.2, 1, 0, 0, 1); + $pat->addColorStopRgba ( 0.8, 1, 0, 0, 0.0); + $con->setSource ($pat); } @@ -30,18 +30,18 @@ function draw_mask ($x, $y) $x += 0.05 * $width; $y += 0.05 * $height; //$s = new CairoImageSurface(FORMAT_ARGB32, 1, 1); - $s = $sur->create_similar ( + $s = $sur->createSimilar ( CONTENT_ALPHA, $wi, $he); $con2 = new CairoContext($s); - $con2->set_source_rgb (1, 1, 1); /* white */ + $con2->setSourceRgb (1, 1, 1); /* white */ $con2->arc (0.5 * $wi, 0.5 * $he, 0.45 * $he, 0, 2 * M_PI); $con2->fill (); - $con->mask_surface ($s, $x, $y); + $con->maskSurface ($s, $x, $y); } @@ -50,13 +50,13 @@ function draw_glyphs ($x, $y) { global $con,$width,$height; - $con->set_font_size (0.8 * $height); + $con->setFontSize (0.8 * $height); - $extents = $con->text_extents ("FG"); - $con->move_to ( + $extents = $con->textExtents ("FG"); + $con->moveTo ( $x + floor (($width - $extents["width"]) / 2 + 0.5) - $extents["x_bearing"], $y + floor (($height - $extents["height"]) / 2 + 0.5) - $extents["y_bearing"]); - $con->show_text ("FG"); + $con->showText ("FG"); } function draw_polygon ($x, $y) @@ -68,14 +68,14 @@ function draw_polygon ($x, $y) $x += 0.05 * $width; $y += 0.05 * $height; - $con->new_path (); - $con->move_to ($x, $y); - $con->line_to ($x, $y + $he); - $con->line_to ($x + $wi / 2, $y + 3 * $he / 4); - $con->line_to ($x + $wi, $y + $he); - $con->line_to ($x + $wi, $y); - $con->line_to ($x + $wi / 2, $y + $he / 4); - $con->close_path (); + $con->newPath (); + $con->moveTo ($x, $y); + $con->lineTo ($x, $y + $he); + $con->lineTo ($x + $wi / 2, $y + 3 * $he / 4); + $con->lineTo ($x + $wi, $y + $he); + $con->lineTo ($x + $wi, $y); + $con->lineTo ($x + $wi / 2, $y + $he / 4); + $con->closePath (); $con->fill (); } @@ -103,7 +103,7 @@ $imheight = 4*($height+$pad) + $pad; $sur = new CairoImageSurface(FORMAT_ARGB32, $imwidth, $imheight); $con = new CairoContext($sur); - $con->select_font_face ( "Bitstream Vera Sans", + $con->selectFontFace ( "Bitstream Vera Sans", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); @@ -116,18 +116,18 @@ $con = new CairoContext($sur); $pat = new CairoLinearGradient ($x + $width, $y, $x, $y + $height); - $pat->add_color_stop_rgba (0.2, + $pat->addColorStopRgba (0.2, 0.0, 0.0, 1.0, 1.0); /* Solid blue */ - $pat->add_color_stop_rgba ( 0.8, + $pat->addColorStopRgba ( 0.8, 0.0, 0.0, 1.0, 0.0); /* Transparent blue */ - $con->set_source ($pat); + $con->setSource ($pat); $con->rectangle ($x, $y, $width, $height); - $con->fill_preserve (); + $con->fillPreserve (); $con->clip (); - $con->set_operator (OPERATOR_CLEAR); + $con->setOperator (OPERATOR_CLEAR); //pattern_funcs[i] ($x, $y); switch($i) { case 0: @@ -157,5 +157,5 @@ $con = new CairoContext($sur); } } -$sur->write_to_png("operator-clear-php.png"); +$sur->writeToPng("operator-clear-php.png"); ?> diff --git a/testcases/phpCairo/operator-source.php b/testcases/phpCairo/operator-source.php index 58a5d52..46f5d49 100644 --- a/testcases/phpCairo/operator-source.php +++ b/testcases/phpCairo/operator-source.php @@ -7,13 +7,13 @@ $pad = 2; function set_solid_pattern ($x, $y) { global $con; - $con->set_source_rgb (1.0, 0, 0.0); + $con->setSourceRgb (1.0, 0, 0.0); } function set_translucent_pattern ($x, $y) { global $con; - $con->set_source_rgba (1,0, 0, 0.5); + $con->setSourceRgba (1,0, 0, 0.5); } @@ -22,9 +22,9 @@ function set_gradient_pattern ($x, $y) global $con,$width,$height; $pat = new CairoLinearGradient ($x, $y, $x + $width, $y + $height); - $pat->add_color_stop_rgba (0.2, 1, 0, 0, 1); - $pat->add_color_stop_rgba ( 0.8, 1, 0, 0, 0.0); - $con->set_source ($pat); + $pat->addColorStopRgba (0.2, 1, 0, 0, 1); + $pat->addColorStopRgba ( 0.8, 1, 0, 0, 0.0); + $con->setSource ($pat); } @@ -35,15 +35,15 @@ function set_surface_pattern($x, $y) $he = floor(0.6*$height); $x+=0.2 * $width; $y+=0.2 * $height; - $s = $sur->create_similar(CONTENT_COLOR_ALPHA, $wi, $he); + $s = $sur->createSimilar(CONTENT_COLOR_ALPHA, $wi, $he); $con2 = new CairoContext($s); - $con2->set_source_rgb(1,0,0); + $con2->setSourceRgb(1,0,0); $con2->paint(); - $con2->set_source_rgb(1,1,1); + $con2->setSourceRgb(1,1,1); $con2->arc ( 0.5 * $wi, 0.5 * $he, 0.5 * $he, 0, 2 * M_PI); $con2->fill(); - $s->write_to_png("temp1.png"); - $con->set_source_surface($s,$x,$y); + $s->writeToPng("temp1.png"); + $con->setSourceSurface($s,$x,$y); unset($s); //unset($con2); } @@ -58,18 +58,18 @@ function draw_mask ($x, $y) $x += 0.05 * $width; $y += 0.05 * $height; $s = new CairoImageSurface(FORMAT_ARGB32, 1, 1); - $s = $sur->create_similar ( + $s = $sur->createSimilar ( CONTENT_ALPHA, $wi, $he); $con2 = new CairoContext($s); - $con2->set_source_rgb (1, 1, 1); /* white */ + $con2->setSourceRgb (1, 1, 1); /* white */ $con2->arc (0.5 * $wi, 0.5 * $he, 0.45 * $he, 0, 2 * M_PI); $con2->fill (); - $con->mask_surface ($s, $x, $y); + $con->maskSurface ($s, $x, $y); unset($s); } @@ -78,13 +78,13 @@ function draw_glyphs ($x, $y) { global $con,$width,$height; - $con->set_font_size (0.8 * $height); + $con->setFontSize (0.8 * $height); - $extents = $con->text_extents ("FG"); - $con->move_to ( + $extents = $con->textExtents ("FG"); + $con->moveTo ( $x + floor (($width - $extents["width"]) / 2 + 0.5) - $extents["x_bearing"], $y + floor (($height - $extents["height"]) / 2 + 0.5) - $extents["y_bearing"]); - $con->show_text ("FG"); + $con->showText ("FG"); } function draw_polygon ($x, $y) @@ -96,14 +96,14 @@ function draw_polygon ($x, $y) $x += 0.05 * $width; $y += 0.05 * $height; - $con->new_path (); - $con->move_to ($x, $y); - $con->line_to ($x, $y + $he); - $con->line_to ($x + $wi / 2, $y + 3 * $he / 4); - $con->line_to ($x + $wi, $y + $he); - $con->line_to ($x + $wi, $y); - $con->line_to ($x + $wi / 2, $y + $he / 4); - $con->close_path (); + $con->newPath (); + $con->moveTo ($x, $y); + $con->lineTo ($x, $y + $he); + $con->lineTo ($x + $wi / 2, $y + 3 * $he / 4); + $con->lineTo ($x + $wi, $y + $he); + $con->lineTo ($x + $wi, $y); + $con->lineTo ($x + $wi / 2, $y + $he / 4); + $con->closePath (); $con->fill (); } @@ -131,7 +131,7 @@ $imheight = 4*($height+$pad) + $pad; $sur = new CairoImageSurface(FORMAT_ARGB32, $imwidth, $imheight); $con = new CairoContext($sur); - $con->select_font_face ( "Bitstream Vera Sans", + $con->selectFontFace ( "Bitstream Vera Sans", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); @@ -144,18 +144,18 @@ $con = new CairoContext($sur); $pat = new CairoLinearGradient ($x + $width, $y, $x, $y + $height); - $pat->add_color_stop_rgba (0.2, + $pat->addColorStopRgba (0.2, 0.0, 0.0, 1.0, 1.0); /* Solid blue */ - $pat->add_color_stop_rgba ( 0.8, + $pat->addColorStopRgba ( 0.8, 0.0, 0.0, 1.0, 0.0); /* Transparent blue */ - $con->set_source ($pat); + $con->setSource ($pat); $con->rectangle ($x, $y, $width, $height); - $con->fill_preserve (); + $con->fillPreserve (); $con->clip (); - $con->set_operator (OPERATOR_SOURCE); + $con->setOperator (OPERATOR_SOURCE); //pattern_funcs[i] ($x, $y); switch($i) { case 0: @@ -191,5 +191,5 @@ $con = new CairoContext($sur); } } -$sur->write_to_png("operator-source-php.png"); +$sur->writeToPng("operator-source-php.png"); ?> diff --git a/testcases/phpCairo/over-above-source-php.png b/testcases/phpCairo/over-above-source-php.png index f679cac6607e13c41fb26f41ccb10dc190fe0ed0..2e4a8887a518c47d88162cebf51070761abd6da5 100644 GIT binary patch delta 19 acwU>uGK*z`9fypdrjePmp65olD~td$D+N~o delta 19 bcwU>uGK*z`9S0w`D(`W_uctP;U10translate($pad, $pad); -$con->move_to($size/2, $size/2); -$con->rel_line_to($size/2, 0); -$con->rel_line_to($size/-2, $size/2); -$con->close_path(); +$con->moveTo($size/2, $size/2); +$con->relLineTo($size/2, 0); +$con->relLineTo($size/-2, $size/2); +$con->closePath(); -$con->set_operator(OPERATOR_SOURCE); -$con->set_source_rgba(1,0,0,0.5); +$con->setOperator(OPERATOR_SOURCE); +$con->setSourceRgba(1,0,0,0.5); $con->fill(); $con->arc($size/2, $size/2, $size/4, 0, 2*M_PI); -$con->set_operator(OPERATOR_OVER); -$con->set_source_rgba(0,1,0,0.5); +$con->setOperator(OPERATOR_OVER); +$con->setSourceRgba(0,1,0,0.5); $con->fill(); -$sur->write_to_png("over-above-source-php.png"); +$sur->writeToPng("over-above-source-php.png"); ?> diff --git a/testcases/phpCairo/over-between-source-php.png b/testcases/phpCairo/over-between-source-php.png index 3b5d21788783b323e3642556c6cbccdfbb707092..50c51939e8ffd399eb2183785836d997f3b91365 100644 GIT binary patch delta 19 bcwXDjvY%yw9fypdrp2{s$HOtranslate($pad, $pad); -$con->move_to($size/5, $size/5); -$con->rel_line_to($size/2, 0); -$con->rel_line_to($size/-2, $size/2); -$con->close_path(); - -$con->set_operator(OPERATOR_SOURCE); -$con->set_source_rgba(1,0,0,0.5); - -$con->fill(); - -$con->arc($size/2, $size/2, $size/4, 0, 2*M_PI); -$con->set_operator(OPERATOR_OVER); -$con->set_source_rgba(0,1,0,0.5); - -$con->fill(); - -$con->move_to($size/2, $size/2); -$con->rel_line_to($size/2, 0); -$con->rel_line_to($size/-2, $size/2); -$con->close_path(); - -$con->set_operator(OPERATOR_SOURCE); -$con->set_source_rgba(1,0,0,0.5); - -$con->fill(); - -$sur->write_to_png("over-between-source-php.png"); -?> - +translate($pad, $pad); +$con->moveTo($size/5, $size/5); +$con->relLineTo($size/2, 0); +$con->relLineTo($size/-2, $size/2); +$con->closePath(); + +$con->setOperator(OPERATOR_SOURCE); +$con->setSourceRgba(1,0,0,0.5); + +$con->fill(); + +$con->arc($size/2, $size/2, $size/4, 0, 2*M_PI); +$con->setOperator(OPERATOR_OVER); +$con->setSourceRgba(0,1,0,0.5); + +$con->fill(); + +$con->moveTo($size/2, $size/2); +$con->relLineTo($size/2, 0); +$con->relLineTo($size/-2, $size/2); +$con->closePath(); + +$con->setOperator(OPERATOR_SOURCE); +$con->setSourceRgba(1,0,0,0.5); + +$con->fill(); + +$sur->writeToPng("over-between-source-php.png"); +?> + diff --git a/testcases/phpCairo/paint-source-alpha-php.png b/testcases/phpCairo/paint-source-alpha-php.png index 1ceb0873d865d5a2f18f3fb5038382bc463d3caa..37ff76243403032ceb22c827b351913d1999ae8c 100644 GIT binary patch delta 18 acwSq~xR`N*9fypd7UQCQGIJ)n#R32`7zM)s delta 18 ZcwSq~xR`N*9S0wesD*d8;QWbhu>dcL1wa4* diff --git a/testcases/phpCairo/paint-source-alpha.php b/testcases/phpCairo/paint-source-alpha.php index c620149..bfcbd24 100644 --- a/testcases/phpCairo/paint-source-alpha.php +++ b/testcases/phpCairo/paint-source-alpha.php @@ -49,13 +49,12 @@ $data.=chr(0x80); } echo $data; $s = new CairoImageSurface(FORMAT_ARGB32, 100,100); -$s->create_from_data($data, FORMAT_ARGB32, 4, 4, 16); -//$con->test_paint_checkered(); +$s->createFromData($data, FORMAT_ARGB32, 4, 4, 16); $con->scale(4,4); -$con->set_source_surface($s,2,2); -$pat = $con->get_source(); -$pat->set_filter( FILTER_NEAREST); +$con->setSourceSurface($s,2,2); +$pat = $con->getSource(); +$pat->setFilter( FILTER_NEAREST); $con->paint(); -$sur->write_to_png("paint-source-alpha-php.png"); +$sur->writeToPng("paint-source-alpha-php.png"); ?> diff --git a/testcases/phpCairo/pdf-surface-source-php.png b/testcases/phpCairo/pdf-surface-source-php.png index 396e8edca8af2955ce8942e727e93e2ee2f3f5de..4e9c2ad672895f74251ad634dae7581078e82a36 100644 GIT binary patch delta 19 acwW2Dbf0O09fypd7PnLO*QSkbl8gXB4+by* delta 19 bcwW2Dbf0O09S0vTi`wJ)skb+}NiqTeM1uyg diff --git a/testcases/phpCairo/pdf-surface-source.pdf b/testcases/phpCairo/pdf-surface-source.pdf dissimilarity index 100% index 71c8fd66a51db8e531feed20fb1a50dca7b79f82..3ee236e3bd42313f8071b2bd9bf37832a5e482fb 100644 GIT binary patch literal 1994 zcwW6#PiWIn94>RB1cD-X+36h|Z0Op&v}rpTMc1zD)VbJ8 z2IDDF7=H16>z63VKmw$)CJGZ1AaM?xHMRI_r?4R=WZG(qWtI(&oD)vp$}RkfZo=_F_HL zKs8U?MWf2&(vmwXVWYOndec0q6RI_l&SMJrx}oFp^rR=(V3vw$o-~@o#3lpTJzVVf z;d|$m7>gYofIqJe-2%VYel&*eefsjWvJyVx4;#;KzIz)!uI#+LKX@$CFD2ktCg4{( z!mo_)mzzI3eQEn#a?wSN;U-8*o*|d|rz&Dxtm#+{J==}CVb+3(iVTwlfmy_;Vb=Ce2&2aTYoBxul}?P#jJ?rH@r6#}%vf3*Isabk%%#*)V&UsIS(VghgHJZ+H&V-6 zrx|y& zG$pMjPoFdMU2@+3x{ukG%;Zq|E3qIFpA=4XwnP0LYR_W8DKap7v~ zZ9COw(;DO14S+U|B&QDZr@1u=9r4ko;x77E-LB}?Y#OA!nvGV_Cn3-C#|Q-@Ix;8$ z{Pi7&G8kE9ta&n#aKIWx%~eCU;)K>lN4<EbxVSq+O3FS zWSim@QQ%#idm7XT|jIgP9N}^H~U!Qz1-|A}~1{!m<(!W3sXv zgHkva@&|^nR4T+7D%k*MMv+m+)HPBwZeYh5r_>1HWheVhHDj*uOa(l(7^2KI6sGM@ M-SF_#Tu~JM0+i(lwEzGB literal 2211 zcwTi@YkR6V5dM7l714UXAzq52#XDXqt%|l)QACJ{B6qv(={0u6#Xl_->Ng1{h z{XIoB^rq-S3UHzedPf})IY1PsY>vvOK_;CpAjN^GK!*YZ>eh{;E~~myH{K|aM&F|M zLxQFu9S=}o>5IB@L>Bt+6>1d7AgHCw4ddXcJDyFbsQSP*G(*Ag z#z{Kbuh2C<)~YT88E!C~Ic-!;y8_xL2f8Sn_baS_(p3HHJoa=jzL^@FB+YQ3DZ1M$ zbmZBym9>O?u&;3LZ2{H(T^M(kfBREHUBT7(! z2h|lehVCL{jl6L#c}HpgO#C@X2;iW5G%v#c*$u@JU*YG-wME_0&<3Lukp@ZcukVKU9kpabSx(&hL}Q z?6@4r&fCL4;U*n$%DLH#j~fh$RRcei_hr@S@X_*m&n9;(p1*5NX9El@>p7p2E!D~A z5}6tKs%wR1Dtx3_8`OnONZ=!Kg&=k-I9<-_ONEWE0!pCq(vjkuB_FX?duQ%8*SQu3 zRwJL06c|w|RED5sHCBV!LnQvr$Oc-0~3&ECN=z8z2cb+cNrcr>AqJHA|w$7w)$j z>#CF>7^WUB?$UNTE0E%n%*OJ|I3MLBEiI(s6t@>!%XzSG%^O2`1ys=<8H0+k>n+mhDq#J+D&j{{7hbWKH)?)?MO0izYk;q)3 z)fUS0riIQD2KqU5Q=jrtX=gKz!`<7udskj(*dZ+DkG-0J_F%f|gtQo$mUV?#W}1@H zqz-Z$cRTV{5VOKCwPYUAu9?+YSoI&RWN*bs^(P)TW^$ zss;rFHlbw55X{lq#J|tN6CkfR<7i6|dGX6z=__sg;JyOgPtBiV`vD?=D1Vaaf9?M; z320DPP+$Z=j0zMNoPJ#BoJ8;eRAlx8;5Dw%?H2NvI8og}+5qp*p1&Z!bI6LWt-hgj z5NG=Rd@s(4rs;E|dTQ9m+3j)};Ft9;$@hXEcr1H09;>L3DOW%p(L0#`OYdj%_zUMk z6J&4G0H6Nu{xOFNjfCR;b22`FSBWs>)OTMG;@&HVXDxJGE?vwMvRKh;`q+70)Lxna fU@*mo4*I_VF|W*-UW~!u*cMd{B?pz3M+W-`VVs^A diff --git a/testcases/phpCairo/pdf-surface-source.php b/testcases/phpCairo/pdf-surface-source.php index 277e7b7..60efac3 100644 --- a/testcases/phpCairo/pdf-surface-source.php +++ b/testcases/phpCairo/pdf-surface-source.php @@ -5,35 +5,35 @@ draw_pattern ($surface_size) { global $s; $con = new CairoContext($s); - $con->set_source_rgb (1, 1, 1); + $con->setSourceRgb (1, 1, 1); $con->rectangle (0, 0, $surface_size / 2, $surface_size / 2); $con->fill (); - $con->set_source_rgb ( 1, 0, 0); + $con->setSourceRgb ( 1, 0, 0); $con->rectangle ($surface_size / 2, 0,$surface_size / 2, $surface_size / 2); $con->fill (); - $con->set_source_rgb ( 0, 1, 0); + $con->setSourceRgb ( 0, 1, 0); $con->rectangle (0, $surface_size / 2, $surface_size / 2, $surface_size / 2); $con->fill (); - $con->set_source_rgb ( 0, 0, 1); + $con->setSourceRgb ( 0, 0, 1); $con->rectangle ($surface_size / 2, $surface_size / 2, $surface_size / 2, $surface_size / 2); $con->fill (); -// $s->write_to_png("temp1.png"); +// $s->writeToPng("temp1.png"); } $size = 90; $sur = new CairoPDFSurface("pdf-surface-source.pdf", $size, $size); -$sur->set_fallback_resolution(72,72); +$sur->setFallbackResolution(72,72); $con = new CairoContext($sur); -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->paint(); $surface_size = $size - 30; $s = new CairoPDFSurface("temp.pdf", $surface_size, $surface_size); draw_pattern($surface_size); -$s->write_to_png("temp1.png"); -$con->set_source_surface($s, 15.0, 15.0); +$s->writeToPng("temp1.png"); +$con->setSourceSurface($s, 15.0, 15.0); $con->paint(); -$sur->write_to_png("pdf-surface-source-php.png"); +$sur->writeToPng("pdf-surface-source-php.png"); ?> diff --git a/testcases/phpCairo/ps-surface-source-php.png b/testcases/phpCairo/ps-surface-source-php.png index a4733130571dd7d8dc1f4bdf9d791c733934d860..7c0558b484d7879a2a5f495d8b780e8558ac5aa4 100644 GIT binary patch delta 19 acwW2Dbf0O09fypdmXI1ltkXs}Nk#xTu>{xv delta 19 bcwW2Dbf0O09S0vTi_uTljmtK=NiqTeL+A#O diff --git a/testcases/phpCairo/ps-surface-source.php b/testcases/phpCairo/ps-surface-source.php index 7072ee2..780fa54 100644 --- a/testcases/phpCairo/ps-surface-source.php +++ b/testcases/phpCairo/ps-surface-source.php @@ -5,35 +5,35 @@ draw_pattern ($surface_size) { global $s; $con = new CairoContext($s); - $con->set_source_rgb (1, 1, 1); + $con->setSourceRgb (1, 1, 1); $con->rectangle (0, 0, $surface_size / 2, $surface_size / 2); $con->fill (); - $con->set_source_rgb ( 1, 0, 0); + $con->setSourceRgb ( 1, 0, 0); $con->rectangle ($surface_size / 2, 0,$surface_size / 2, $surface_size / 2); $con->fill (); - $con->set_source_rgb ( 0, 1, 0); + $con->setSourceRgb ( 0, 1, 0); $con->rectangle (0, $surface_size / 2, $surface_size / 2, $surface_size / 2); $con->fill (); - $con->set_source_rgb ( 0, 0, 1); + $con->setSourceRgb ( 0, 0, 1); $con->rectangle ($surface_size / 2, $surface_size / 2, $surface_size / 2, $surface_size / 2); $con->fill (); -// $s->write_to_png("temp1.png"); +// $s->writeToPng("temp1.png"); } $size = 90; -$sur = new CairoPSSurface("pdf-surface-source.pdf", $size, $size); -$sur->set_fallback_resolution(72,72); +$sur = new CairoPSSurface("ps-surface-source.ps", $size, $size); +$sur->setFallbackResolution(72,72); $con = new CairoContext($sur); -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->paint(); $surface_size = $size - 30; $s = new CairoPSSurface("temp.pdf", $surface_size, $surface_size); draw_pattern($surface_size); -$s->write_to_png("temp1.png"); -$con->set_source_surface($s, 15.0, 15.0); +$s->writeToPng("temp1.png"); +$con->setSourceSurface($s, 15.0, 15.0); $con->paint(); -$sur->write_to_png("ps-surface-source-php.png"); +$sur->writeToPng("ps-surface-source-php.png"); ?> diff --git a/testcases/phpCairo/pdf-surface-source.pdf b/testcases/phpCairo/ps-surface-source.ps similarity index 98% copy from testcases/phpCairo/pdf-surface-source.pdf copy to testcases/phpCairo/ps-surface-source.ps index 71c8fd6..6334682 100644 --- a/testcases/phpCairo/pdf-surface-source.pdf +++ b/testcases/phpCairo/ps-surface-source.ps @@ -1,6 +1,6 @@ %!PS-Adobe-3.0 %%Creator: cairo 1.4.12 (http://cairographics.org) -%%CreationDate: Sat Jun 14 18:34:50 2008 +%%CreationDate: Sat Jun 28 23:12:18 2008 %%Pages: 1 %%BoundingBox: 0 0 90 90 %%DocumentData: Clean7Bit diff --git a/testcases/phpCairo/random-intersection-php.png b/testcases/phpCairo/random-intersection-php.png index bd4ffb88c4ea8758b6b1d447596937bc113e86d1..b126d6e74a2a0ebdb3ac66eae9499aa74a9946d4 100644 GIT binary patch delta 19 acwYM-{6Bbt9fyn%F9WZYg4ss5otgkf#s(|^ delta 19 bcwYM-{6Bbt9S0w;lset_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->paint(); $state = 0x123456; $con->translate(1,1); -$con->set_fill_rule(FILL_RULE_EVEN_ODD); -$con->move_to(0,0); +$con->setFillRule(FILL_RULE_EVEN_ODD); +$con->moveTo(0,0); for($i=0; $i<$numseg;$i++) { $x = uniform_random(0,$width); $y = uniform_random(0,$height); -$con->line_to($x,$y); +$con->lineTo($x,$y); //echo "x = $x"; //echo "y = $y"; } -$con->close_path(); -$con->set_source_rgb(1,0,0); -$con->fill_preserve(); -$con->set_source_rgb(0,1,0); -$con->set_line_width(0.5); +$con->closePath(); +$con->setSourceRgb(1,0,0); +$con->fillPreserve(); +$con->setSourceRgb(0,1,0); +$con->setLineWidth(0.5); $con->stroke(); -$sur->write_to_png("random-intersection-php.png"); +$sur->writeToPng("random-intersection-php.png"); ?> diff --git a/testcases/phpCairo/rectangle-rounding-error-php.png b/testcases/phpCairo/rectangle-rounding-error-php.png index 1a82c48fec2bb24d96abdaec2cee8e1f5ca462e6..5a74483611ea52abe4ee924f6879bb7a53e756a3 100644 GIT binary patch delta 18 ZcwSq@w2Enh9fyn%FWZyIR_2LrPXIFW1@Hg> delta 18 acwSq@w2Enh9S0w;yz1oz|9?+(djbGEHV3u< diff --git a/testcases/phpCairo/rectangle-rounding-error.php b/testcases/phpCairo/rectangle-rounding-error.php index c04f6f1..e80eb2d 100644 --- a/testcases/phpCairo/rectangle-rounding-error.php +++ b/testcases/phpCairo/rectangle-rounding-error.php @@ -2,10 +2,10 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 76,76); $con = new CairoContext($sur); -$con->set_source_rgb ( 1, 1, 1); +$con->setSourceRgb ( 1, 1, 1); $con->paint (); -$con->set_antialias (ANTIALIAS_NONE); -$con->set_source_rgb ( 0, 0, 0); +$con->setAntialias (ANTIALIAS_NONE); +$con->setSourceRgb ( 0, 0, 0); $con->translate( -300, -300); $con->scale( 677.0/26, 677.0/26); @@ -14,9 +14,9 @@ $con->rectangle( 11, 11, 1, 1); $con->rectangle( 11, 12, 1, 1); $con->rectangle( 12, 11, 1, 1); $con->rectangle( 12, 12, 1, 1); -$con->set_source_rgb( 0, 0, 0); +$con->setSourceRgb( 0, 0, 0); $con->fill(); -$sur->write_to_png("rectangle-rounding-error-php.png"); +$sur->writeToPng("rectangle-rounding-error-php.png"); ?> diff --git a/testcases/phpCairo/rectilinear-stroke.php b/testcases/phpCairo/rectilinear-stroke.php dissimilarity index 62% index 2214ffc..a472f97 100644 --- a/testcases/phpCairo/rectilinear-stroke.php +++ b/testcases/phpCairo/rectilinear-stroke.php @@ -1,101 +1,101 @@ -set_source_rgb (1.0, 1.0, 1.0); /* white */ - $con->paint (); - $con->set_source_rgb (0.0, 0.0, 0.0); /* black */ - - $con->set_line_width (1.0); - $con->translate (1, 1); - - /* Draw everything first with square caps. */ - $con->set_line_cap (LINE_CAP_SQUARE); - - /* Draw horizontal and vertical segments, each in both - * directions. */ - $con->move_to ( 4.5, 0.5); - $con->rel_line_to ( 2.0, 0.0); - - $con->move_to (10.5, 4.5); - $con->rel_line_to ( 0.0, 2.0); - - $con->move_to ( 6.5, 10.5); - $con->rel_line_to (-2.0, 0.0); - - $con->move_to ( 0.5, 6.5); - $con->rel_line_to ( 0.0, -2.0); - - /* Draw right angle turns in four directions. */ - $con->move_to ( 0.5, 2.5); - $con->rel_line_to ( 0.0, -2.0); - $con->rel_line_to ( 2.0, 0.0); - - $con->move_to ( 8.5, 0.5); - $con->rel_line_to ( 2.0, 0.0); - $con->rel_line_to ( 0.0, 2.0); - - $con->move_to (10.5, 8.5); - $con->rel_line_to ( 0.0, 2.0); - $con->rel_line_to (-2.0, 0.0); - - $con->move_to ( 2.5, 10.5); - $con->rel_line_to (-2.0, 0.0); - $con->rel_line_to ( 0.0, -2.0); - - /* Draw a closed-path rectangle */ - $con->rectangle (0.5, 12.5, 10.0, 10.0); - - $con->stroke (); - - $con->translate (12, 0); - - /* Now draw the same results, but with butt caps. */ - $con->set_line_cap (LINE_CAP_BUTT); - - /* Draw horizontal and vertical segments, each in both - * directions. */ - $con->move_to ( 4.0, 0.5); - $con->rel_line_to ( 3.0, 0.0); - - $con->move_to (10.5, 4.0); - $con->rel_line_to ( 0.0, 3.0); - - $con->move_to ( 7.0, 10.5); - $con->rel_line_to (-3.0, 0.0); - - $con->move_to ( 0.5, 7.0); - $con->rel_line_to ( 0.0, -3.0); - - /* Draw right angle turns in four directions. */ - $con->move_to ( 0.5, 3.0); - $con->rel_line_to ( 0.0, -2.5); - $con->rel_line_to ( 2.5, 0.0); - - $con->move_to ( 8.0, 0.5); - $con->rel_line_to ( 2.5, 0.0); - $con->rel_line_to ( 0.0, 2.5); - - $con->move_to (10.5, 8.0); - $con->rel_line_to ( 0.0, 2.5); - $con->rel_line_to (-2.5, 0.0); - - $con->move_to ( 3.0, 10.5); - $con->rel_line_to (-2.5, 0.0); - $con->rel_line_to ( 0.0, -2.5); - - /* Draw a closed-path rectangle */ - $con->rectangle (0.5, 12.5, 10.0, 10.0); - - /* Draw a path that is rectilinear initially, but not completely */ - /* We draw this out of the target window. The bug that caused this - * addition was leaks if part of the path was rectilinear but not - * completely */ - $con->move_to ( 3.0, 30.5); - $con->rel_line_to (-2.5, 0.0); - $con->rel_line_to (+2.5, +2.5); - - $con->stroke (); - $sur->write_to_png("rectilinear-stroke-php.png"); -?> +setSourceRgb (1.0, 1.0, 1.0); /* white */ + $con->paint (); + $con->setSourceRgb (0.0, 0.0, 0.0); /* black */ + + $con->setLineWidth (1.0); + $con->translate (1, 1); + + /* Draw everything first with square caps. */ + $con->setLineCap (LINE_CAP_SQUARE); + + /* Draw horizontal and vertical segments, each in both + * directions. */ + $con->moveTo ( 4.5, 0.5); + $con->relLineTo ( 2.0, 0.0); + + $con->moveTo (10.5, 4.5); + $con->relLineTo ( 0.0, 2.0); + + $con->moveTo ( 6.5, 10.5); + $con->relLineTo (-2.0, 0.0); + + $con->moveTo ( 0.5, 6.5); + $con->relLineTo ( 0.0, -2.0); + + /* Draw right angle turns in four directions. */ + $con->moveTo ( 0.5, 2.5); + $con->relLineTo ( 0.0, -2.0); + $con->relLineTo ( 2.0, 0.0); + + $con->moveTo ( 8.5, 0.5); + $con->relLineTo ( 2.0, 0.0); + $con->relLineTo ( 0.0, 2.0); + + $con->moveTo (10.5, 8.5); + $con->relLineTo ( 0.0, 2.0); + $con->relLineTo (-2.0, 0.0); + + $con->moveTo ( 2.5, 10.5); + $con->relLineTo (-2.0, 0.0); + $con->relLineTo ( 0.0, -2.0); + + /* Draw a closed-path rectangle */ + $con->rectangle (0.5, 12.5, 10.0, 10.0); + + $con->stroke (); + + $con->translate (12, 0); + + /* Now draw the same results, but with butt caps. */ + $con->setLineCap (LINE_CAP_BUTT); + + /* Draw horizontal and vertical segments, each in both + * directions. */ + $con->moveTo ( 4.0, 0.5); + $con->relLineTo ( 3.0, 0.0); + + $con->moveTo (10.5, 4.0); + $con->relLineTo ( 0.0, 3.0); + + $con->moveTo ( 7.0, 10.5); + $con->relLineTo (-3.0, 0.0); + + $con->moveTo ( 0.5, 7.0); + $con->relLineTo ( 0.0, -3.0); + + /* Draw right angle turns in four directions. */ + $con->moveTo ( 0.5, 3.0); + $con->relLineTo ( 0.0, -2.5); + $con->relLineTo ( 2.5, 0.0); + + $con->moveTo ( 8.0, 0.5); + $con->relLineTo ( 2.5, 0.0); + $con->relLineTo ( 0.0, 2.5); + + $con->moveTo (10.5, 8.0); + $con->relLineTo ( 0.0, 2.5); + $con->relLineTo (-2.5, 0.0); + + $con->moveTo ( 3.0, 10.5); + $con->relLineTo (-2.5, 0.0); + $con->relLineTo ( 0.0, -2.5); + + /* Draw a closed-path rectangle */ + $con->rectangle (0.5, 12.5, 10.0, 10.0); + + /* Draw a path that is rectilinear initially, but not completely */ + /* We draw this out of the target window. The bug that caused this + * addition was leaks if part of the path was rectilinear but not + * completely */ + $con->moveTo ( 3.0, 30.5); + $con->relLineTo (-2.5, 0.0); + $con->relLineTo (+2.5, +2.5); + + $con->stroke (); + $sur->writeToPng("rectilinear-stroke-php.png"); +?> diff --git a/testcases/phpCairo/reflected-stroke-php.png b/testcases/phpCairo/reflected-stroke-php.png index 1c61be11e0b4e48678249ab2b306d017bcef5d1f..514ce05f4b1c9460ae9ab75c36310ea5adc0ac54 100644 GIT binary patch delta 19 acwT$2^rectangle ( -25, -25, 50, 50); $con->stroke (); - $con->move_to ( 0, -25); - $con->curve_to ( 12.5, -12.5, 12.5, -12.5, 0, 0); - $con->curve_to ( -12.5, 12.5, -12.5, 12.5, 0, 25); - $con->curve_to ( 12.5, 12.5, 12.5, 12.5, 0, 0); + $con->moveTo ( 0, -25); + $con->curveTo ( 12.5, -12.5, 12.5, -12.5, 0, 0); + $con->curveTo ( -12.5, 12.5, -12.5, 12.5, 0, 25); + $con->curveTo ( 12.5, 12.5, 12.5, 12.5, 0, 0); $con->stroke (); $con->save (); - $con->set_dash ( $dash, 2, 0.); - $con->move_to ( 0, 0); + $con->setDash ( $dash, 2, 0.); + $con->moveTo ( 0, 0); $con->arc ( 0, 0, 12.5, 0, 3 * M_PI / 2); - $con->close_path (); + $con->closePath (); $con->stroke (); $con->restore (); } $sur = new CairoImageSurface(FORMAT_ARGB32,200,200); $con = new CairoContext($sur); - $con->set_source_rgb ( 1, 1, 1); + $con->setSourceRgb ( 1, 1, 1); $con->paint (); - $con->set_source_rgb ( 0, 0, 0); + $con->setSourceRgb ( 0, 0, 0); $con->save (); $con->translate ( 50, 50); @@ -51,6 +51,6 @@ function draw_symbol () $con->scale ( 1, -1); draw_symbol (); $con->restore (); - $sur->write_to_png("reflected-stroke-php.png"); + $sur->writeToPng("reflected-stroke-php.png"); ?> diff --git a/testcases/phpCairo/rotate-image-surface-paint-php.png b/testcases/phpCairo/rotate-image-surface-paint-php.png index 5d569de8c52cec1975fc8292f408fe7f9462f29d..3ee122e572eaa7a5c51320dde2db576b4d3db20d 100644 GIT binary patch delta 18 ZcwXyc>SLN<#~~xcEA+29ux_H;2>>z~1~UKv delta 18 ZcwXyc>SLN<$H6Dep!`trmexeK696yb1>gVx diff --git a/testcases/phpCairo/rotate-image-surface-paint.php b/testcases/phpCairo/rotate-image-surface-paint.php index acacc85..42f4ac5 100644 --- a/testcases/phpCairo/rotate-image-surface-paint.php +++ b/testcases/phpCairo/rotate-image-surface-paint.php @@ -7,22 +7,22 @@ $s = new CairoImageSurface(FORMAT_RGB24, $surface_size, $surface_size); $con2 = new CairoContext($s); - $con2->set_source_rgb ( 1, 1, 1); + $con2->setSourceRgb ( 1, 1, 1); $con2->rectangle ( 0, 0, $surface_size / 2, $surface_size / 2); $con2->fill (); - $con2->set_source_rgb ( 1, 0, 0); + $con2->setSourceRgb ( 1, 0, 0); $con2->rectangle ( $surface_size / 2, 0, $surface_size / 2, $surface_size / 2); $con2->fill (); - $con2->set_source_rgb ( 0, 1, 0); + $con2->setSourceRgb ( 0, 1, 0); $con2->rectangle ( 0, $surface_size / 2, $surface_size / 2, $surface_size / 2); $con2->fill (); - $con2->set_source_rgb ( 0, 0, 1); + $con2->setSourceRgb ( 0, 0, 1); $con2->rectangle ( $surface_size / 2, $surface_size / 2, $surface_size / 2, $surface_size / 2); @@ -31,20 +31,20 @@ /* First paint opaque background (black) so we don't need separate * ARGB32 and RGB24 reference images. */ - $con->set_source_rgb ( 0, 0, 0); /* black */ + $con->setSourceRgb ( 0, 0, 0); /* black */ $con->paint (); $con->translate( $size/2, $size/2); $con->rotate ( M_PI / 4.0); $con->translate ( -$surface_size/2, -$surface_size/2); - $con->set_source_surface ( $s, 0, 0); - $pat = $con->get_source(); + $con->setSourceSurface ( $s, 0, 0); + $pat = $con->getSource(); - $pat->set_filter(FILTER_NEAREST); - $con->set_source($pat); + $pat->setFilter(FILTER_NEAREST); + $con->setSource($pat); $con->paint (); - $sur->write_to_png("rotate-image-surface-paint-php.png"); + $sur->writeToPng("rotate-image-surface-paint-php.png"); ?> diff --git a/testcases/phpCairo/scale-down-source-surface-paint-php.png b/testcases/phpCairo/scale-down-source-surface-paint-php.png index 39d9a47e36244b39e147e2166461a20af220305d..4516a17528000ce55757ae8f67d07b4f3d8a8ab3 100644 GIT binary patch delta 18 ZcwTE|Y-OBa#~~xcEA=7brq4t-djK%{1-k$M delta 18 ZcwTE|Y-OBa$H6BoC_dSTw|}CWJpd}R1ib(N diff --git a/testcases/phpCairo/scale-down-source-surface-paint.php b/testcases/phpCairo/scale-down-source-surface-paint.php index 99ca10f..f7ba1ec 100644 --- a/testcases/phpCairo/scale-down-source-surface-paint.php +++ b/testcases/phpCairo/scale-down-source-surface-paint.php @@ -47,18 +47,17 @@ $data.=chr(0x00); $data.=chr(0x00); $data.=chr(0xff); } -echo $data; -$con->set_source_rgb(0,0,0); +$con->setSourceRgb(0,0,0); $con->paint(); $s = new CairoImageSurface(FORMAT_ARGB32, 100,100); -$s->create_from_data($data, FORMAT_RGB24, 4, 4, 16); +$s->createFromData($data, FORMAT_RGB24, 4, 4, 16); //$con->test_paint_checkered(); $con->scale(0.5,0.5); -$con->set_source_surface($s,4,4); -$pat = $con->get_source(); -$pat->set_filter( FILTER_NEAREST); +$con->setSourceSurface($s,4,4); +$pat = $con->getSource(); +$pat->setFilter( FILTER_NEAREST); $con->paint(); -$sur->write_to_png("scale-down-source-surface-paint-php.png"); +$sur->writeToPng("scale-down-source-surface-paint-php.png"); ?> diff --git a/testcases/phpCairo/scale-source-surface-paint-php.png b/testcases/phpCairo/scale-source-surface-paint-php.png index d33de04bd6d8fd88dcbe40c21c569f1270e6fc57..6ae09a109c156f33c9646638e76f7332a3e8a4db 100644 GIT binary patch delta 18 ZcwU>#IGJ&R9fyn%uY7}%?%|1Uz5p$l1s?za delta 18 ZcwU>#IGJ&R9S5JVkYQHN?Tr)Nd;u|~1?d0) diff --git a/testcases/phpCairo/scale-source-surface-paint.php b/testcases/phpCairo/scale-source-surface-paint.php index 414776b..e6dcf58 100644 --- a/testcases/phpCairo/scale-source-surface-paint.php +++ b/testcases/phpCairo/scale-source-surface-paint.php @@ -48,17 +48,16 @@ $data.=chr(0x00); $data.=chr(0xff); } echo $data; -//$con->set_source_rgb(0,0,0); +//$con->setSourceRgb(0,0,0); //$con->paint(); $s = new CairoImageSurface(FORMAT_ARGB32, 100,100); -$s->create_from_data($data, FORMAT_RGB24, 4, 4, 16); -//$con->test_paint_checkered(); +$s->createFromData($data, FORMAT_RGB24, 4, 4, 16); $con->scale(2,2); -$con->set_source_surface($s,1,1); -$pat = $con->get_source(); -$pat->set_filter( FILTER_NEAREST); +$con->setSourceSurface($s,1,1); +$pat = $con->getSource(); +$pat->setFilter( FILTER_NEAREST); $con->paint(); -$sur->write_to_png("scale-source-surface-paint-php.png"); +$sur->writeToPng("scale-source-surface-paint-php.png"); ?> diff --git a/testcases/phpCairo/select-font-face-php.png b/testcases/phpCairo/select-font-face-php.png index 171ac1acd18cdf85671c6702368bbf6dc3bcf351..a52d627fe93197e9b60770e9bd1bed3305699860 100644 GIT binary patch delta 19 bcwYO#{eydg9fyn%uhzB3mk&0&ZDIugO~VKf delta 19 bcwYO#{eydg9S5JVB$vhH*Kr%&Hn9Q#MUDpJ diff --git a/testcases/phpCairo/select-font-face.php b/testcases/phpCairo/select-font-face.php index 284a939..dba1bdf 100644 --- a/testcases/phpCairo/select-font-face.php +++ b/testcases/phpCairo/select-font-face.php @@ -3,30 +3,30 @@ $sur = new CairoImageSurface(FORMAT_ARGB32, 192, 16); $con = new CairoContext($sur); $con->save (); - $con->set_source_rgb ( 1.0, 1.0, 1.0); /* white */ + $con->setSourceRgb ( 1.0, 1.0, 1.0); /* white */ $con->paint (); $con->restore (); - $con->set_source_rgb ( 0, 0, 0); /* black */ + $con->setSourceRgb ( 0, 0, 0); /* black */ - $con->select_font_face ( "Bitstream Vera Serif", + $con->selectFontFace ( "Bitstream Vera Serif", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); - $con->set_font_size ( $TEXT_SIZE); + $con->setFontSize ( $TEXT_SIZE); - $con->move_to ( 0, $TEXT_SIZE); - $con->show_text ( "i-am-serif"); + $con->moveTo ( 0, $TEXT_SIZE); + $con->showText ( "i-am-serif"); - $con->select_font_face ( "Bitstream Vera Sans", + $con->selectFontFace ( "Bitstream Vera Sans", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); - $con->show_text ( " i-am-sans"); + $con->showText ( " i-am-sans"); - $con->select_font_face ( "Bitstream Vera Sans Mono", + $con->selectFontFace ( "Bitstream Vera Sans Mono", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL); - $con->show_text ( " i-am-mono"); - $sur->write_to_png("select-font-face-php.png"); + $con->showText ( " i-am-mono"); + $sur->writeToPng("select-font-face-php.png"); ?> diff --git a/testcases/phpCairo/self-copy-php.png b/testcases/phpCairo/self-copy-php.png index 3b241e5804808307d1b62860af21050b84b39298..f202ddd53b051acabcd3cc54eb3cf35b3e2187b2 100644 GIT binary patch delta 18 acwSq~w3umv9fyn%ui2r7t?MVc-30(Q8V2kD delta 18 acwSq~w3umv9S5JVno{VG%o!8i?g9Wb$Oeo6 diff --git a/testcases/phpCairo/self-copy.php b/testcases/phpCairo/self-copy.php index abbf465..e0d0776 100644 --- a/testcases/phpCairo/self-copy.php +++ b/testcases/phpCairo/self-copy.php @@ -2,14 +2,14 @@ $size = 40; $sur = new CairoImageSurface(FORMAT_ARGB32, $size, $size); $con = new CairoContext($sur); - $con->set_source_rgb ( 1, 1, 1); /* White */ + $con->setSourceRgb ( 1, 1, 1); /* White */ $con->paint (); - $con->move_to ( $size, 0); - $con->line_to ( $size, $size); - $con->line_to ( 0, $size); + $con->moveTo ( $size, 0); + $con->lineTo ( $size, $size); + $con->lineTo ( 0, $size); - $con->set_source_rgb ( 0, 0, 0); + $con->setSourceRgb ( 0, 0, 0); $con->fill (); /* Create a pattern with the target surface as the source, @@ -18,9 +18,9 @@ $pattern = new CairoSurfacePattern ($sur); $matrix = new CairoMatrix(); $matrix->translate ( - $size / 2, - $size / 2); - $pattern->set_matrix ( $matrix); + $pattern->setMatrix ( $matrix); - $con->set_source ($pattern); + $con->setSource ($pattern); /* Copy two rectangles from the upper-left quarter of the image to * the lower right. It will work if we use $con->fill(), but the @@ -36,6 +36,6 @@ $size / 4, $size / 4); $con->clip (); $con->paint (); - $sur->write_to_png("self-copy-php.png"); + $sur->writeToPng("self-copy-php.png"); ?> diff --git a/testcases/phpCairo/self-intersecting-php.png b/testcases/phpCairo/self-intersecting-php.png index 861694989f14b8c5cd8af5631371c9807c78f98b..495ad396bdd6e2e3f6cf4dbef646b0512ef135ff 100644 GIT binary patch delta 18 ZcwYO*_>Xad9fyn%A7h|^bMi#D9RN5h1*iZ3 delta 18 acwYO*_>Xad9S5JVj*iFrHKG&Ub^riAQ3jO& diff --git a/testcases/phpCairo/self-intersecting.php b/testcases/phpCairo/self-intersecting.php index a1e2353..251f727 100644 --- a/testcases/phpCairo/self-intersecting.php +++ b/testcases/phpCairo/self-intersecting.php @@ -3,7 +3,7 @@ $con = new CairoContext($sur); $con->translate (1.0, 1.0); - $con->set_source_rgb (1, 0, 0); /* red */ + $con->setSourceRgb (1, 0, 0); /* red */ /* First draw the desired shape with a fill */ $con->rectangle (0.5, 0.5, 4.0, 4.0); @@ -15,16 +15,16 @@ /* Then try the same thing with a stroke */ $con->translate (0, 10); - $con->move_to (1.0, 1.0); - $con->rel_line_to ( 3.0, 0.0); - $con->rel_line_to ( 0.0, 6.0); - $con->rel_line_to ( 3.0, 0.0); - $con->rel_line_to ( 0.0, -3.0); - $con->rel_line_to (-6.0, 0.0); - $con->close_path (); + $con->moveTo (1.0, 1.0); + $con->relLineTo ( 3.0, 0.0); + $con->relLineTo ( 0.0, 6.0); + $con->relLineTo ( 3.0, 0.0); + $con->relLineTo ( 0.0, -3.0); + $con->relLineTo (-6.0, 0.0); + $con->closePath (); - $con->set_line_width (1.0); + $con->setLineWidth (1.0); $con->stroke (); - $sur->write_to_png("self-intersecting-php.png"); + $sur->writeToPng("self-intersecting-php.png"); ?> diff --git a/testcases/phpCairo/set-source-php.png b/testcases/phpCairo/set-source-php.png index e315eced9926e5775660002d2bb857bee43c133c..29d316693ad0b632c52c591eb9f1e01b4893e37e 100644 GIT binary patch delta 16 XcwVchm|({tBgDtPqxf0aL^mScreate_from_data($color, FORMAT_ARGB32, 1,1,4); +$s->createFromData($color, FORMAT_ARGB32, 1,1,4); $pat = new CairoSurfacePattern($s); -$pat->set_extend(EXTEND_REPEAT); +$pat->setExtend(EXTEND_REPEAT); for($i=0; $i<5; $i++) { switch($i) { case 0: - $con->set_source_rgb(.6,.7,.8); + $con->setSourceRgb(.6,.7,.8); break; case 1: - $con->set_source_rgba(.2,.4,.6,.5); + $con->setSourceRgba(.2,.4,.6,.5); break; case 2: - $con->set_source_rgba(.2,.4,.6,.5); + $con->setSourceRgba(.2,.4,.6,.5); break; case 3: default: - $con->set_source($pat); + $con->setSource($pat); } $con->rectangle($i,0,1,5); $con->fill(); } -$sur->write_to_png("set-source-php.png"); +$sur->writeToPng("set-source-php.png"); ?> diff --git a/testcases/phpCairo/show-text-current-point-php.png b/testcases/phpCairo/show-text-current-point-php.png index 46d13632f5efc0304a3dfd02133cb8047635e3b9..0c62a08c7e8d904c45d2f8ac2e275a77b5a6af68 100644 GIT binary patch delta 19 acwXDVw}Wqj9fyn%A8*7mevgfApV$C7t_AP_ delta 19 bcwXDVw}Wqj9S5HXr?z$Z|0^5aKCuA+KqCh& diff --git a/testcases/phpCairo/show-text-current-point.php b/testcases/phpCairo/show-text-current-point.php dissimilarity index 63% index 655f4d4..b584b14 100644 --- a/testcases/phpCairo/show-text-current-point.php +++ b/testcases/phpCairo/show-text-current-point.php @@ -1,23 +1,23 @@ -save (); - $con->set_source_rgb ( 1.0, 1.0, 1.0); /* white */ - $con->paint (); - $con->restore (); - - $con->select_font_face ( "Bitstream Vera Sans", - FONT_SLANT_NORMAL, - FONT_WEIGHT_NORMAL); - $con->set_font_size (12); - - $con->set_source_rgb ( 0, 0, 0); /* black */ - - $con->move_to ( 0, 12); - $con->show_text ( "Hello from the "); - $con->show_text ( "show-text-current-point-php"); - $con->show_text ( " test."); - $sur->write_to_png("show-text-current-point-php.png"); - - -?> +save (); + $con->setSourceRgb ( 1.0, 1.0, 1.0); /* white */ + $con->paint (); + $con->restore (); + + $con->selectFontFace ( "Bitstream Vera Sans", + FONT_SLANT_NORMAL, + FONT_WEIGHT_NORMAL); + $con->setFontSize (12); + + $con->setSourceRgb ( 0, 0, 0); /* black */ + + $con->moveTo ( 0, 12); + $con->showText ( "Hello from the "); + $con->showText ( "show-text-current-point-php"); + $con->showText ( " test."); + $sur->writeToPng("show-text-current-point-php.png"); + + +?> diff --git a/testcases/phpCairo/source-clip-php.png b/testcases/phpCairo/source-clip-php.png index 4ff3bf4646cf66c229dab35e036ea5820de0e88e..a39a9017ab6b703753c83c2fd7caf8c3bcf68e83 100644 GIT binary patch delta 18 ZcwTE|Y-OBa#~~xcC+M?0n0=y~Jpd|a1d{*& delta 18 ZcwTE|Y-OBa$H6Bepki>sJ9eU*Jpe1c1n&R< diff --git a/testcases/phpCairo/source-clip.php b/testcases/phpCairo/source-clip.php index d6a430f..d28a0a8 100644 --- a/testcases/phpCairo/source-clip.php +++ b/testcases/phpCairo/source-clip.php @@ -1,7 +1,7 @@ create_similar ( + $source = $sur->createSimilar ( CONTENT_COLOR_ALPHA, 12, 12); @@ -9,7 +9,7 @@ /* Fill the source surface with green */ - $con2->set_source_rgb ( 0, 1, 0); + $con2->setSourceRgb ( 0, 1, 0); $con2->paint (); /* Draw a blue square in the middle of the source with clipping, @@ -18,18 +18,18 @@ 12 / 4, 12 / 4, 12 / 2, 12 / 2); $con2->clip (); - $con2->set_source_rgb ( 0, 0, 1); + $con2->setSourceRgb ( 0, 0, 1); $con2->paint (); /* Fill the destination surface with solid red (should not appear * in final result) */ - $con->set_source_rgb ( 1, 0, 0); + $con->setSourceRgb ( 1, 0, 0); $con->paint (); /* Now draw the source surface onto the destination surface */ - $con->set_source_surface ( $source, 0, 0); + $con->setSourceSurface ( $source, 0, 0); $con->paint (); - $sur->write_to_png("source-clip-php.png"); + $sur->writeToPng("source-clip-php.png"); ?> diff --git a/testcases/phpCairo/sphere.php b/testcases/phpCairo/sphere.php index be10eea..43bd4a1 100644 --- a/testcases/phpCairo/sphere.php +++ b/testcases/phpCairo/sphere.php @@ -1,27 +1,27 @@ set_antialias(0); -$ctx->set_fill_rule(0); +$ctx->setAntialias(0); +$ctx->setFillRule(0); $ctx->scale(256/1.0, 256/1.0); $pat = new CairoLinearGradient(0.0, 0.0, 0.0, 1.0); -$pat->add_color_stop_rgba(1, 0, 0, 0, 1); -$pat->add_color_stop_rgba(0, 1, 1, 1, 1); +$pat->addColorStopRgba(1, 0, 0, 0, 1); +$pat->addColorStopRgba(0, 1, 1, 1, 1); $ctx->rectangle(0,0,1,1); -$ctx->set_source($pat); +$ctx->setSource($pat); //$ctx->stroke(); $ctx->fill(); $pat = new CairoRadialGradient(0.45, 0.4, 0.1, 0.4, 0.4, 0.5); -$pat->add_color_stop_rgba(0, 1, 1, 1, 1); -$pat->add_color_stop_rgba(1, 0, 0, 0, 1); -$ctx->set_source($pat); +$pat->addColorStopRgba(0, 1, 1, 1, 1); +$pat->addColorStopRgba(1, 0, 0, 0, 1); +$ctx->setSource($pat); $ctx->arc(.5, .5, .3, 0, 2*3.14); //$ctx->fill(); //$ctx->stroke(); $ctx->fill(); -$Surface->write_to_png("image.png"); +$Surface->writeToPng("image.png"); ?> diff --git a/testcases/phpCairo/temp.pdf b/testcases/phpCairo/temp.pdf index d873174..ed7344b 100644 --- a/testcases/phpCairo/temp.pdf +++ b/testcases/phpCairo/temp.pdf @@ -1,6 +1,6 @@ %!PS-Adobe-3.0 %%Creator: cairo 1.4.12 (http://cairographics.org) -%%CreationDate: Sat Jun 14 18:34:50 2008 +%%CreationDate: Sat Jun 28 23:12:18 2008 %%Pages: 1 %%BoundingBox: 0 0 60 60 %%DocumentData: Clean7Bit diff --git a/testcases/phpCairo/temp.ps b/testcases/phpCairo/temp.ps new file mode 100644 index 0000000..5310896 --- /dev/null +++ b/testcases/phpCairo/temp.ps @@ -0,0 +1,71 @@ +%!PS-Adobe-3.0 +%%Creator: cairo 1.4.12 (http://cairographics.org) +%%CreationDate: Sat Jun 28 16:51:33 2008 +%%Pages: 1 +%%BoundingBox: 0 0 100 100 +%%DocumentData: Clean7Bit +%%LanguageLevel: 2 +%%EndComments +%%BeginProlog +/C{curveto}bind def +/F{fill}bind def +/G{setgray}bind def +/L{lineto}bind def +/M{moveto}bind def +/P{closepath}bind def +/R{setrgbcolor}bind def +/S{show}bind def +/xS{xshow}bind def +/yS{yshow}bind def +/xyS{xyshow}bind def +%%EndProlog +% _cairo_ps_surface_emit_font_subsets +%%Page: 1 1 +%%BeginPageSetup +%%PageBoundingBox: 0 0 100 100 +gsave 0 100 translate 1.0 -1.0 scale +%%EndPageSetup +% _cairo_ps_surface_stroke +0 0 1 R +gsave +50 50 moveto -15536 -15536 lineto [1 0 0 1 0 0] concat +2 setlinewidth +0 setlinecap +0 setlinejoin +10 setmiterlimit +stroke +grestore +% _cairo_ps_surface_stroke +0 1 0 R +gsave +50 50 moveto 15536 -15536 lineto [1 0 0 1 0 0] concat +2 setlinewidth +0 setlinecap +0 setlinejoin +10 setmiterlimit +stroke +grestore +% _cairo_ps_surface_stroke +1 0 0 R +gsave +50 50 moveto -15536 15536 lineto [1 0 0 1 0 0] concat +2 setlinewidth +0 setlinecap +0 setlinejoin +10 setmiterlimit +stroke +grestore +% _cairo_ps_surface_stroke +1 1 0 R +gsave +50 50 moveto 15536 15536 lineto [1 0 0 1 0 0] concat +2 setlinewidth +0 setlinecap +0 setlinejoin +10 setmiterlimit +stroke +grestore +grestore +showpage +%%Trailer +%%EOF diff --git a/testcases/phpCairo/temp1.png b/testcases/phpCairo/temp1.png index 08fb8f3aab6694a3168cc3c352a2758257d6bd2d..5bebac134cc669f64bb05b3af2cc6b7096cd203d 100644 GIT binary patch delta 18 ZcwRflc#d&`9fypdmXI1ltkXod4gfKR1p)v7 delta 18 acwRflc#d&`9S0vTi_uTljmsvwbpQZ61qQkR diff --git a/testcases/phpCairo/test-extents.php b/testcases/phpCairo/test-extents.php dissimilarity index 68% index 75d8a63..030b456 100644 --- a/testcases/phpCairo/test-extents.php +++ b/testcases/phpCairo/test-extents.php @@ -1,25 +1,25 @@ -select_font_face("Sans"); -$con->set_font_size(100); -$ext = $con->text_extents($char); -$x = 25.0; -$y = 150.0; -$con->move_to($x, $y); -$con->show_text($char); - -$con->set_source_rgba(1,0.2,0.2,0.6); -$con->set_line_width(6.0); -$con->arc($x, $y, 10, 0, 2*3.14); -$con->fill(); -$con->move_to($x, $y); -$con->rel_line_to(0, -1*$ext["height"]); -$con->rel_line_to($ext["width"], 0); -$con->rel_line_to($ext["x_bearing"], -1*$ext["y_bearing"]); -$con->stroke(); -$sur->write_to_png("image_text_extents.png"); -?> - - +selectFontFace("Sans"); +$con->setFontSize(100); +$ext = $con->textExtents($char); +$x = 25.0; +$y = 150.0; +$con->moveTo($x, $y); +$con->showText($char); + +$con->setSourceRgba(1,0.2,0.2,0.6); +$con->setLineWidth(6.0); +$con->arc($x, $y, 10, 0, 2*3.14); +$con->fill(); +$con->moveTo($x, $y); +$con->relLineTo(0, -1*$ext["height"]); +$con->relLineTo($ext["width"], 0); +$con->relLineTo($ext["x_bearing"], -1*$ext["y_bearing"]); +$con->stroke(); +$sur->writeToPng("image_text_extents.png"); +?> + + -- 2.11.4.GIT