-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8831 from brave/mpilgrim_webgl_extensions
Implement new WebGL extensions blocking logic
- Loading branch information
Showing
7 changed files
with
164 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
22 changes: 22 additions & 0 deletions
22
chromium_src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Copyright (c) 2021 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_RENDERING_CONTEXT_BASE_H_ | ||
#define BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_RENDERING_CONTEXT_BASE_H_ | ||
|
||
#define getExtension \ | ||
getExtension_ChromiumImpl(ScriptState*, const String& name); \ | ||
ScriptValue getExtension | ||
|
||
#define getSupportedExtensions \ | ||
getSupportedExtensions_ChromiumImpl(); \ | ||
base::Optional<Vector<String>> getSupportedExtensions | ||
|
||
#include "../../../../../../third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h" | ||
|
||
#undef getSupportedExtensions | ||
#undef getExtension | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_RENDERING_CONTEXT_BASE_H_ |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>WebGL getExtension() test</title> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<canvas id="test" width="8" height="8"></canvas> | ||
<script> | ||
var canvas = document.getElementById("test"); | ||
var gl = canvas.getContext("webgl"); | ||
var ext_list = []; | ||
for (const [i, name] of Object.entries(gl.getSupportedExtensions())) { | ||
ext_list = ext_list.concat(gl.getExtension(name) ? name : null); | ||
} | ||
document.title = ext_list.join(""); | ||
</script> | ||
</body> | ||
</html> | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>WebGL getSupportedExtensions() test</title> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<canvas id="test" width="8" height="8"></canvas> | ||
<script> | ||
var canvas = document.getElementById("test"); | ||
var gl = canvas.getContext("webgl"); | ||
var ext_list = gl.getSupportedExtensions(); | ||
document.title = ext_list.join(","); | ||
</script> | ||
</body> | ||
</html> |