Support non-square texture page sizes. #687

Merged
merged 1 commit into from Jan 6, 2017

Projects

None yet

3 participants

@glennw
Member
glennw commented Jan 6, 2017 edited

This will be taken advantage of in a follow up PR
that adjusts the intermediate render targets (which
use the texture page allocator) to be the same size
as the framebuffer.


This change is Reviewable

@glennw
Member
glennw commented Jan 6, 2017
@kvark
kvark approved these changes Jan 6, 2017 View changes

Looks great, just one minor thing to address

webrender/src/texture_cache.rs
- DeviceUintPoint::new(0, self.texture_size),
- DeviceUintSize::new(self.texture_size, new_texture_size - self.texture_size)));
+ fn grow(&mut self, new_texture_size: DeviceUintSize) {
+ let new_rects = [
@kvark
kvark Jan 6, 2017 Member

we should probably assert on new_texture_size >= texture_size here, since the code expects it to be true and would do strange things in release (while failing on arithmetic overflow in debug)

@glennw glennw Support non-square texture page sizes.
This will be taken advantage of in a follow up PR
that adjusts the intermediate render targets (which
use the texture page allocator) to be the same size
as the framebuffer.
122ba09
@glennw
Member
glennw commented Jan 6, 2017

@kvark Thanks for the review - added assert to catch that case.

@kvark
Member
kvark commented Jan 6, 2017

Thanks @glennw !
@bors-servo r+

@bors-servo
Contributor

📌 Commit 122ba09 has been approved by kvark

@bors-servo
Contributor

⌛️ Testing commit 122ba09 with merge a3a5bdb...

@bors-servo bors-servo added a commit that referenced this pull request Jan 6, 2017
@bors-servo bors-servo Auto merge of #687 - glennw:page-2d, r=kvark
Support non-square texture page sizes.

This will be taken advantage of in a follow up PR
that adjusts the intermediate render targets (which
use the texture page allocator) to be the same size
as the framebuffer.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/687)
<!-- Reviewable:end -->
a3a5bdb
@bors-servo
Contributor

☀️ Test successful - status-travis

@bors-servo bors-servo merged commit 122ba09 into servo:master Jan 6, 2017

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment