Skip to content
This repository has been archived by the owner. It is now read-only.

Implement fill_rect for surface pattern with repetition style. #160

Merged
merged 1 commit into from Jun 11, 2015

Conversation

@hyowon
Copy link
Contributor

hyowon commented May 19, 2015

SurfacePattern has ExtendMode::REPEAT.
Clipping is used to handle 'repeat-x', 'repeat-y' and 'no-repeat'.

@hyowon hyowon force-pushed the hyowon:fill_rect_with_pattern branch from 1ab4827 to 77cac5f May 22, 2015
@hyowon
Copy link
Contributor Author

hyowon commented May 22, 2015

I've modified the implementation using clipping because of side-effects.
Instead of clipping, repetitive drawing codes are added for repeat-x and repeat-y.

@hyowon
Copy link
Contributor Author

hyowon commented May 22, 2015

cc @jdm
cc @yichoi

@larsbergstrom
Copy link
Contributor

larsbergstrom commented May 22, 2015

@pcwalton
Copy link
Contributor

pcwalton commented May 22, 2015

What side effects did you run into? Tiling manually like this is going to negatively affect performance.

@hyowon
Copy link
Contributor Author

hyowon commented May 23, 2015

@pcwalton I'm sorry for the confusion. The clipping affects all other operations such as composition options. (2d.composite.uncovered.fill.destination-atop test was failed.) However, as you mentioned, repetitive drawing is not good for performance. I noticed just adjusting the destination rect can control the region being painted. Please review again.

@hyowon hyowon force-pushed the hyowon:fill_rect_with_pattern branch from 77cac5f to a381538 May 23, 2015
bors-servo pushed a commit to servo/servo that referenced this pull request May 28, 2015
Issue #6056
Depends on servo/rust-azure#160

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6157)
<!-- Reviewable:end -->
@Manishearth
Copy link
Member

Manishearth commented May 28, 2015

Bump; this blocks servo/servo#6157

unsafe {
AzDrawTargetFillRect(self.azure_draw_target,
&mut rect.as_azure_rect(),
&mut draw_rect.as_azure_rect(),

This comment has been minimized.

@pcwalton

pcwalton May 29, 2015

Contributor

Why not just pass rect in directly? I'd rather have the callers of fill_rect do the conversion from rect to draw_rect as necessary and leave this function more or less as is.

@hyowon hyowon force-pushed the hyowon:fill_rect_with_pattern branch from a381538 to 41dea91 Jun 1, 2015
@hyowon
Copy link
Contributor Author

hyowon commented Jun 1, 2015

@pcwalton I was concerned about generating duplicate code if there are several callers of fill_rect.
But now, calculating the draw_rect has only to be moved once.
Please take a look at hyowon/servo@0f84597.

@metajack
Copy link
Contributor

metajack commented Jun 1, 2015

@pcwalton assigned to you. And ping.

@hyowon hyowon force-pushed the hyowon:fill_rect_with_pattern branch from 41dea91 to 7386513 Jun 4, 2015
pcwalton added a commit that referenced this pull request Jun 11, 2015
Implement fill_rect for surface pattern with repetition style.
@pcwalton pcwalton merged commit b9bb83c into servo:master Jun 11, 2015
@hyowon hyowon deleted the hyowon:fill_rect_with_pattern branch Jun 13, 2015
bors-servo pushed a commit to servo/servo that referenced this pull request Jun 13, 2015
Issue #6056
Depends on servo/rust-azure#160

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6157)
<!-- Reviewable:end -->
bors-servo pushed a commit to servo/servo that referenced this pull request Jun 13, 2015
Issue #6056
Depends on servo/rust-azure#160

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6157)
<!-- Reviewable:end -->
jrmuizel pushed a commit to jrmuizel/gecko-cinnabar that referenced this pull request Jun 12, 2017
…owon:canvas_pattern_fill); r=nox

Issue #6056
Depends on servo/rust-azure#160

Source-Repo: https://github.com/servo/servo
Source-Revision: 9474e62d38f61f2b3a385ca32d64cab975b014ce
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Sep 30, 2019
…owon:canvas_pattern_fill); r=nox

Issue #6056
Depends on servo/rust-azure#160

Source-Repo: https://github.com/servo/servo
Source-Revision: 9474e62d38f61f2b3a385ca32d64cab975b014ce

UltraBlame original commit: f3e3496c1267d50b7ebaada7b343b7fc92fba9b2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…owon:canvas_pattern_fill); r=nox

Issue #6056
Depends on servo/rust-azure#160

Source-Repo: https://github.com/servo/servo
Source-Revision: 9474e62d38f61f2b3a385ca32d64cab975b014ce

UltraBlame original commit: f3e3496c1267d50b7ebaada7b343b7fc92fba9b2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…owon:canvas_pattern_fill); r=nox

Issue #6056
Depends on servo/rust-azure#160

Source-Repo: https://github.com/servo/servo
Source-Revision: 9474e62d38f61f2b3a385ca32d64cab975b014ce

UltraBlame original commit: f3e3496c1267d50b7ebaada7b343b7fc92fba9b2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.