-
Notifications
You must be signed in to change notification settings - Fork 297
Implement WebGLContext resize #519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me, thanks for doing it!
I'd like @glennw to sign-off the device-touching code, if that's possible.
@@ -779,6 +779,13 @@ impl TextureCache { | |||
}) | |||
} | |||
|
|||
pub fn add_raw_remove(&mut self, id: TextureId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_raw_remove
sounds a bit weird, though it follows the convention. I can't think of an immediately better name now, so I guess this is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it does follow the convention. Perhaps, the convention should be revised? as a separate PR
let prev_texture_id = self.webgl_textures.get(&id).unwrap(); | ||
|
||
// Remove existing cache if texture id has changed | ||
if !prev_texture_id.eq(&texture_id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason !eq()
and clone()
are used instead of !=
and *
(since this is Copy
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize that it is Copy
;)
@@ -779,6 +779,13 @@ impl TextureCache { | |||
}) | |||
} | |||
|
|||
pub fn add_raw_remove(&mut self, id: TextureId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it does follow the convention. Perhaps, the convention should be revised? as a separate PR
6e4a4a2
to
48f204a
Compare
48f204a
to
d8bcc18
Compare
@bors-servo r+ |
📌 Commit d8bcc18 has been approved by |
Implement WebGLContext resize Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize <!-- 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/519) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
Implement WebGLContext resize <!-- Please describe your changes on the following line: --> Related PR: servo/webrender#519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14075) <!-- Reviewable:end -->
Implement WebGLContext resize <!-- Please describe your changes on the following line: --> Related PR: servo/webrender#519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14075) <!-- Reviewable:end -->
Implement WebGLContext resize <!-- Please describe your changes on the following line: --> Related PR: servo/webrender#519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14075) <!-- Reviewable:end -->
Implement WebGLContext resize <!-- Please describe your changes on the following line: --> Related PR: servo/webrender#519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14075) <!-- Reviewable:end -->
…o:webgl-resize); r=MortimerGoro <!-- Please describe your changes on the following line: --> Related PR: servo/webrender#519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 94eefc4001e0998fcea5a35943da73624ea82b13
…o:webgl-resize); r=MortimerGoro <!-- Please describe your changes on the following line: --> Related PR: servo/webrender#519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 94eefc4001e0998fcea5a35943da73624ea82b13 UltraBlame original commit: fc18c37273eda7200f883473b7409526bb03a592
…o:webgl-resize); r=MortimerGoro <!-- Please describe your changes on the following line: --> Related PR: servo/webrender#519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 94eefc4001e0998fcea5a35943da73624ea82b13 UltraBlame original commit: fc18c37273eda7200f883473b7409526bb03a592
…o:webgl-resize); r=MortimerGoro <!-- Please describe your changes on the following line: --> Related PR: servo/webrender#519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 94eefc4001e0998fcea5a35943da73624ea82b13 UltraBlame original commit: fc18c37273eda7200f883473b7409526bb03a592
Implement WebGLContext resize (canvas.width & canvas.height). I have tested:
This change is