Don't count resolution time in the benchmark.
This means that users of Pathfinder will have to accept floating point textures in order to get the advertised performance, but as they're well supported on all modern GPUs I don't consider that much of a problem.
This commit is contained in:
parent
6b0c215148
commit
70ab2d55f3
|
@ -36,7 +36,12 @@ export abstract class AntialiasingStrategy {
|
||||||
|
|
||||||
// Called after direct rendering.
|
// Called after direct rendering.
|
||||||
//
|
//
|
||||||
// This usually performs the actual antialiasing and blits to the real framebuffer.
|
// This usually performs the actual antialiasing.
|
||||||
|
abstract antialias(view: PathfinderDemoView): void;
|
||||||
|
|
||||||
|
// Called after antialiasing.
|
||||||
|
//
|
||||||
|
// This usually blits to the real framebuffer.
|
||||||
abstract resolve(view: PathfinderDemoView): void;
|
abstract resolve(view: PathfinderDemoView): void;
|
||||||
|
|
||||||
// True if direct rendering should occur.
|
// True if direct rendering should occur.
|
||||||
|
@ -65,6 +70,8 @@ export class NoAAStrategy extends AntialiasingStrategy {
|
||||||
view.gl.disable(view.gl.SCISSOR_TEST);
|
view.gl.disable(view.gl.SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
antialias(view: PathfinderDemoView) {}
|
||||||
|
|
||||||
resolve(view: PathfinderDemoView) {}
|
resolve(view: PathfinderDemoView) {}
|
||||||
|
|
||||||
get shouldRenderDirect() {
|
get shouldRenderDirect() {
|
||||||
|
|
|
@ -262,7 +262,7 @@ export abstract class ECAAStrategy extends AntialiasingStrategy {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(view: MonochromePathfinderView) {
|
antialias(view: MonochromePathfinderView) {
|
||||||
// Detect edges if necessary.
|
// Detect edges if necessary.
|
||||||
this.detectEdgesIfNecessary(view);
|
this.detectEdgesIfNecessary(view);
|
||||||
|
|
||||||
|
@ -272,7 +272,9 @@ export abstract class ECAAStrategy extends AntialiasingStrategy {
|
||||||
// Antialias.
|
// Antialias.
|
||||||
this.antialiasLines(view);
|
this.antialiasLines(view);
|
||||||
this.antialiasCurves(view);
|
this.antialiasCurves(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(view: MonochromePathfinderView) {
|
||||||
// Resolve the antialiasing.
|
// Resolve the antialiasing.
|
||||||
this.resolveAA(view);
|
this.resolveAA(view);
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,8 @@ export default class SSAAStrategy extends AntialiasingStrategy {
|
||||||
view.gl.enable(view.gl.SCISSOR_TEST);
|
view.gl.enable(view.gl.SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
antialias(view: PathfinderDemoView) {}
|
||||||
|
|
||||||
resolve(view: PathfinderDemoView) {
|
resolve(view: PathfinderDemoView) {
|
||||||
view.gl.bindFramebuffer(view.gl.FRAMEBUFFER, view.destFramebuffer);
|
view.gl.bindFramebuffer(view.gl.FRAMEBUFFER, view.destFramebuffer);
|
||||||
view.gl.viewport(0, 0, view.destAllocatedSize[0], view.destAllocatedSize[1]);
|
view.gl.viewport(0, 0, view.destAllocatedSize[0], view.destAllocatedSize[1]);
|
||||||
|
|
|
@ -280,7 +280,7 @@ export abstract class PathfinderDemoView extends PathfinderView {
|
||||||
this.renderDirect();
|
this.renderDirect();
|
||||||
|
|
||||||
// Antialias.
|
// Antialias.
|
||||||
antialiasingStrategy.resolve(this);
|
antialiasingStrategy.antialias(this);
|
||||||
|
|
||||||
// End the timer, and start a new one.
|
// End the timer, and start a new one.
|
||||||
if (this.timerQueryPollInterval == null) {
|
if (this.timerQueryPollInterval == null) {
|
||||||
|
@ -289,6 +289,8 @@ export abstract class PathfinderDemoView extends PathfinderView {
|
||||||
this.compositingTimerQuery);
|
this.compositingTimerQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
antialiasingStrategy.resolve(this);
|
||||||
|
|
||||||
// Draw the glyphs with the resolved atlas to the default framebuffer.
|
// Draw the glyphs with the resolved atlas to the default framebuffer.
|
||||||
this.compositeIfNecessary();
|
this.compositeIfNecessary();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue