Fundamentally, WebRender is designed to render CSS with better performance on modern hardware than what the traditional combination of a legacy painting API like Skia and a compositor can offer. It does so by merging the painting and compositing steps together into a single API, avoiding the performance pitfalls associated with CSS properties that don't run on the compositor. Instead of an immediate mode API in which objects are rendered back-to-front, WebRender uses a retained mode API that can render objects in any order. Ultimately, WebRender works more like a game engine than a legacy PostScript-like 2D API, which is
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The cardinal rule is to never borrow the inside of a DOM object. | |
// DOM objects don't look like Rust objects to Rust code; their fields are only accessed | |
// with getters and setters. | |
// By forbidding borrowing DOM objects, most of the problems disappear. | |
dom_defclass! { | |
class Node { | |
parent_node: NullableJS<Node>, | |
first_child: NullableJS<Node>, | |
last_child: NullableJS<Node>, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float aastep(float edge0, float edge1, float x) { | |
float t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0) - 0.5; | |
return 1.14191 * t - 0.83570 * t * t * t; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct LayoutObjectRef<T>(Arc<RwLock<LayoutObject<T>>>); | |
struct LayoutObject<T> { | |
style: Arc<ComputedValues>, | |
// position? borders? padding? margins? | |
contents: T, | |
} | |
struct BlockFormattingContext(BlockOrInline); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.hgignore b/.hgignore | |
--- a/.hgignore | |
+++ b/.hgignore | |
@@ -188,3 +188,7 @@ subinclude:servo/.hgignore | |
^testing/raptor/raptor-venv | |
^testing/raptor/raptor/tests/.*.json | |
^testing/raptor/webext/raptor/auto_gen_test_config.js | |
+ | |
+^wr-capture | |
+wr-record.*\.bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Monument</title> | |
<style> | |
/*@keyframes spin { | |
from { transform: rotateY(0) scale(10); } | |
to { transform: rotateY(360deg) scale(30); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pathfinder/shaders/gles2/stencil-aaa.fs.glsl | |
// | |
// Copyright (c) 2018 The Pathfinder Project Developers. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style> | |
body { | |
position: absolute; | |
top: 0; | |
left: 0; |